3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code ='<?php function test($a) { echo $a; } $a = 10; test($a); ?>'; $tokens = token_get_all($code); foreach ($tokens as $row) { echo token_name($row[0]), "\r\n"; }
Output for 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/kNTmX on line 17 T_VARIABLE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE T_ECHO T_WHITESPACE T_VARIABLE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE T_VARIABLE T_WHITESPACE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE T_STRING Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_VARIABLE Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 Warning: token_name() expects parameter 1 to be integer, string given in /in/kNTmX on line 17 T_WHITESPACE T_CLOSE_TAG
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/kNTmX on line 17 T_VARIABLE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE T_ECHO T_WHITESPACE T_VARIABLE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE T_VARIABLE T_WHITESPACE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE T_LNUMBER Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE T_STRING Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_VARIABLE Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 Warning: token_name() expects parameter 1 to be long, string given in /in/kNTmX on line 17 T_WHITESPACE T_CLOSE_TAG