- var_dump: documentation ( source)
- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
$source = <<<'code'
<?php
function system_update_10101(&$sandbox = NULL) {
}
code;
$tokens = token_get_all($source, TOKEN_PARSE);
foreach ($tokens as $token) {
if (is_array($token)) {
echo token_name($token[0]) , PHP_EOL;
}
}
var_dump($tokens[2]);
var_dump($tokens[4]);