- var_dump: documentation ( source)
- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
$tokens = token_get_all('<?php $a = 1 + 2; echo $a ?>');
foreach($tokens as $token) {
var_dump($token);
echo token_name($token[0]);
}