(PHP 8)
PhpToken::tokenize — Splits given source into PHP tokens, represented by PhpToken objects.
public static PhpToken::tokenize ( string $code [, int $flags = 0 ] ) : array
Returns an array of PhpToken objects representing given code
.
code
The PHP source to parse.
flags
Valid flags:
TOKEN_PARSE
- Recognises the ability to use reserved words in specific contexts. An array of PHP tokens represented by instances of PhpToken or its descendants. This method returns static[] so that PhpToken can be seamlessly extended.
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/phptoken.tokenize.php