3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<?php class MyClass { function MyFunction3() { // Some code goes here. } function MyFunction4() { // Some code goes here. } public function register(); } '; $tokens = token_get_all($string); foreach ($tokens as $i => $token) { echo "$i : "; if (is_array($token) === false) { echo $token; } else { echo token_name($token[0]).' => '.str_replace(PHP_EOL, '\n', $token[1]); } echo PHP_EOL; }

preferences:
36.78 ms | 402 KiB | 5 Q