3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( token_get_all('<?php $a == $b; ?>'));
based on r3tkg
Output for 7.0.0 - 7.1.0, 7.2.0
array(9) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(320) [1]=> string(2) "$a" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(285) [1]=> string(2) "==" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(320) [1]=> string(2) "$b" [2]=> int(1) } [6]=> string(1) ";" [7]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(381) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 7.1.5 - 7.1.10
array(9) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(320) [1]=> string(2) "$a" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(289) [1]=> string(2) "==" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(320) [1]=> string(2) "$b" [2]=> int(1) } [6]=> string(1) ";" [7]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(381) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 5.6.0 - 5.6.28
array(9) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(312) [1]=> string(2) "$a" [2]=> int(1) } [2]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(285) [1]=> string(2) "==" [2]=> int(1) } [4]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(312) [1]=> string(2) "$b" [2]=> int(1) } [6]=> string(1) ";" [7]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(378) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 5.5.0 - 5.5.38
array(9) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(310) [1]=> string(2) "$a" [2]=> int(1) } [2]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(284) [1]=> string(2) "==" [2]=> int(1) } [4]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(310) [1]=> string(2) "$b" [2]=> int(1) } [6]=> string(1) ";" [7]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(376) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 5.4.0 - 5.4.45
array(9) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(309) [1]=> string(2) "$a" [2]=> int(1) } [2]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(283) [1]=> string(2) "==" [2]=> int(1) } [4]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(309) [1]=> string(2) "$b" [2]=> int(1) } [6]=> string(1) ";" [7]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(374) [1]=> string(2) "?>" [2]=> int(1) } }