3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = '<?php function blah($num) { if ($num) { return $num + 1; } return 0; } '; $tokens = token_get_all($code); foreach ($tokens as $token) { echo token_name($token[0]) . "\n"; }
based on ooUS1
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
T_OPEN_TAG T_FUNCTION T_WHITESPACE T_STRING Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_VARIABLE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE T_IF T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_VARIABLE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE T_RETURN T_WHITESPACE T_VARIABLE T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE T_RETURN T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/79nZd on line 15 T_WHITESPACE
Output for 4.3.0 - 5.6.28
T_OPEN_TAG T_FUNCTION T_WHITESPACE T_STRING Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_VARIABLE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE T_IF T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_VARIABLE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE T_RETURN T_WHITESPACE T_VARIABLE T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE T_RETURN T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/79nZd on line 15 T_WHITESPACE