array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'phptoken.gettokenname.php', 1 => 'PhpToken::getTokenName', 2 => 'Returns the name of the token.', ), 'up' => array ( 0 => 'class.phptoken.php', 1 => 'PhpToken', ), 'prev' => array ( 0 => 'phptoken.construct.php', 1 => 'PhpToken::__construct', ), 'next' => array ( 0 => 'phptoken.is.php', 1 => 'PhpToken::is', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/tokenizer/phptoken/getTokenName.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8)
PhpToken::getTokenName — Returns the name of the token.
У цієї функції немає параметрів.
An ASCII character for single-char tokens,
or one of T_* constant names for known tokens (see List of Parser Tokens),
or null
for unknown tokens.
Приклад #1 PhpToken::getTokenName() example
<?php
// known token
$token = new PhpToken(T_ECHO, 'echo');
var_dump($token->getTokenName()); // -> string(6) "T_ECHO"
// single-char token
$token = new PhpToken(ord(';'), ';');
var_dump($token->getTokenName()); // -> string(1) ";"
// unknown token
$token = new PhpToken(10000 , "\0");
var_dump($token->getTokenName()); // -> NULL