14 lines
277 B
PHP
14 lines
277 B
PHP
|
<?php declare(strict_types=1);
|
||
|
|
||
|
$file = file_get_contents('test.php');
|
||
|
$tokens = PhpToken::tokenize($file);
|
||
|
|
||
|
function addName (PhpToken $token): PhpToken
|
||
|
{
|
||
|
$token->type = $token->getTokenName();
|
||
|
return $token;
|
||
|
}
|
||
|
|
||
|
$tokens = array_map('addName', $tokens);
|
||
|
|
||
|
var_export($tokens);
|