3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $t = token_get_all('<?php $result = $perf_id == "chris" && $date < strtotime("5th July");'); foreach($t as $i=>$k)if(is_array($t[$i]) && is_int($t[$i][0]))$t[$i][0] = token_name($k[0]); print_r($t);
Output for 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php [2] => 1 ) [1] => Array ( [0] => T_VARIABLE [1] => $result [2] => 1 ) [2] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [3] => = [4] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [5] => Array ( [0] => T_VARIABLE [1] => $perf_id [2] => 1 ) [6] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [7] => Array ( [0] => T_IS_EQUAL [1] => == [2] => 1 ) [8] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [9] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" [2] => 1 ) [10] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [11] => Array ( [0] => T_BOOLEAN_AND [1] => && [2] => 1 ) [12] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [13] => Array ( [0] => T_VARIABLE [1] => $date [2] => 1 ) [14] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [15] => < [16] => Array ( [0] => T_WHITESPACE [1] => [2] => 1 ) [17] => Array ( [0] => T_STRING [1] => strtotime [2] => 1 ) [18] => ( [19] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" [2] => 1 ) [20] => ) [21] => ; )
Output for 4.3.0 - 5.2.1
Array ( [0] => Array ( [0] => T_OPEN_TAG [1] => <?php ) [1] => Array ( [0] => T_VARIABLE [1] => $result ) [2] => Array ( [0] => T_WHITESPACE [1] => ) [3] => = [4] => Array ( [0] => T_WHITESPACE [1] => ) [5] => Array ( [0] => T_VARIABLE [1] => $perf_id ) [6] => Array ( [0] => T_WHITESPACE [1] => ) [7] => Array ( [0] => T_IS_EQUAL [1] => == ) [8] => Array ( [0] => T_WHITESPACE [1] => ) [9] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "chris" ) [10] => Array ( [0] => T_WHITESPACE [1] => ) [11] => Array ( [0] => T_BOOLEAN_AND [1] => && ) [12] => Array ( [0] => T_WHITESPACE [1] => ) [13] => Array ( [0] => T_VARIABLE [1] => $date ) [14] => Array ( [0] => T_WHITESPACE [1] => ) [15] => < [16] => Array ( [0] => T_WHITESPACE [1] => ) [17] => Array ( [0] => T_STRING [1] => strtotime ) [18] => ( [19] => Array ( [0] => T_CONSTANT_ENCAPSED_STRING [1] => "5th July" ) [20] => ) [21] => ; )