The PhpToken classIntroductionThis class provides an alternative to token_get_all. While the function returns tokens either as a single-character string, or an array with a token ID, token text and line number, PhpToken::tokenize normalizes all tokens into PhpToken objects, which makes code operating on tokens more memory efficient and readable. Class synopsis
PhpToken
implements
Stringable
/* Properties */
public
int
$id;
public
string
$text;
public
int
$line;
public
int
$pos;
/* Methods */
final public __construct(
int $id ,string $text ,int $line = -1,int $pos = -1) public stringnull getTokenName()
public bool is(intstringarray
$kind )public bool isIgnorable()
public string __toString()
public static array tokenize(string
$code , int $flags = 0)Properties
|