3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $t = token_get_all('<?php $perf_id == "chris" AND $date < strtotime("5th July");'); foreach($t as $i=>$k)$t[$i][0] = token_name($k[0]); print_r($t);
Output for 7.1.0
Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: Cannot assign an empty string to a string offset in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: Cannot assign an empty string to a string offset in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: Cannot assign an empty string to a string offset in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: Cannot assign an empty string to a string offset in /in/lB5MP on line 3 Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php [2] => 1 ) [1] => Array ( [0] => T_VARIABLE [1] => $perf_id [2] => 1 ) [2] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [3] => Array ( [0] => T_IS_EQUAL [1] => == [2] => 1 ) [4] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [5] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" [2] => 1 ) [6] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [7] => Array ( [0] => T_LOGICAL_AND [1] => AND [2] => 1 ) [8] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [9] => Array ( [0] => T_VARIABLE [1] => $date [2] => 1 ) [10] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [11] => < [12] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [13] => Array ( [0] => T_STRING [1] => strtotime [2] => 1 ) [14] => ( [15] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" [2] => 1 ) [16] => ) [17] => ; )
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be integer, string given in /in/lB5MP on line 3 Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php [2] => 1 ) [1] => Array ( [0] => T_VARIABLE [1] => $perf_id [2] => 1 ) [2] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [3] => Array ( [0] => T_IS_EQUAL [1] => == [2] => 1 ) [4] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [5] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" [2] => 1 ) [6] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [7] => Array ( [0] => T_LOGICAL_AND [1] => AND [2] => 1 ) [8] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [9] => Array ( [0] => T_VARIABLE [1] => $date [2] => 1 ) [10] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [11] => [12] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [13] => Array ( [0] => T_STRING [1] => strtotime [2] => 1 ) [14] => [15] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" [2] => 1 ) [16] => [17] => )
Output for 5.2.2 - 5.6.28
Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php [2] => 1 ) [1] => Array ( [0] => T_VARIABLE [1] => $perf_id [2] => 1 ) [2] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [3] => Array ( [0] => T_IS_EQUAL [1] => == [2] => 1 ) [4] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [5] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" [2] => 1 ) [6] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [7] => Array ( [0] => T_LOGICAL_AND [1] => AND [2] => 1 ) [8] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [9] => Array ( [0] => T_VARIABLE [1] => $date [2] => 1 ) [10] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [11] => [12] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [13] => Array ( [0] => T_STRING [1] => strtotime [2] => 1 ) [14] => [15] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" [2] => 1 ) [16] => [17] => )
Output for 4.3.0 - 5.2.1
Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Warning: token_name() expects parameter 1 to be long, string given in /in/lB5MP on line 3 Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php ) [1] => Array ( [0] => T_VARIABLE [1] => $perf_id ) [2] => Array ( [0] => T_WHITESPACE [1] => ) [3] => Array ( [0] => T_IS_EQUAL [1] => == ) [4] => Array ( [0] => T_WHITESPACE [1] => ) [5] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" ) [6] => Array ( [0] => T_WHITESPACE [1] => ) [7] => Array ( [0] => T_LOGICAL_AND [1] => AND ) [8] => Array ( [0] => T_WHITESPACE [1] => ) [9] => Array ( [0] => T_VARIABLE [1] => $date ) [10] => Array ( [0] => T_WHITESPACE [1] => ) [11] => [12] => Array ( [0] => T_WHITESPACE [1] => ) [13] => Array ( [0] => T_STRING [1] => strtotime ) [14] => [15] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" ) [16] => [17] => )