3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '<?php array( \'one\' => \'hello\', \'two\' => "hello", \'three\' => array(1,2,3), \'four\' => $asset->delete(), ); '; $string = 'array(); '; $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; }
based on lnOq3
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
0 : T_INLINE_HTML => array();
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
0 : Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/U6g5X on line 19 T_INLINE_HTML => array(); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/U6g5X on line 22 PHP_EOL