3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(token_get_all('<?php [1 => true]'), token_name(314));
Output for 7.0.0 - 7.1.0
array(8) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(317) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(268) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(319) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(9) "T_PRIVATE"
Output for 5.6.7 - 5.6.21
array(8) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(308) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(364) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(310) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(13) "T_INLINE_HTML"
Output for 5.5.24 - 5.5.35
array(8) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(306) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(362) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(308) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(15) "T_BAD_CHARACTER"
Output for 5.4.0 - 5.4.45
array(8) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(305) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(360) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(307) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(25) "T_ENCAPSED_AND_WHITESPACE"
Output for 5.3.0 - 5.3.29
array(8) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(305) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(358) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(307) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(25) "T_ENCAPSED_AND_WHITESPACE"
Output for 5.2.2 - 5.2.17
array(8) { [0]=> array(3) { [0]=> int(367) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> string(1) "[" [2]=> array(3) { [0]=> int(305) [1]=> string(1) "1" [2]=> int(1) } [3]=> array(3) { [0]=> int(370) [1]=> string(1) " " [2]=> int(1) } [4]=> array(3) { [0]=> int(357) [1]=> string(2) "=>" [2]=> int(1) } [5]=> array(3) { [0]=> int(370) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(307) [1]=> string(4) "true" [2]=> int(1) } [7]=> string(1) "]" } string(25) "T_ENCAPSED_AND_WHITESPACE"
Output for 5.1.0 - 5.2.1
array(8) { [0]=> array(2) { [0]=> int(367) [1]=> string(6) "<?php " } [1]=> string(1) "[" [2]=> array(2) { [0]=> int(305) [1]=> string(1) "1" } [3]=> array(2) { [0]=> int(370) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(357) [1]=> string(2) "=>" } [5]=> array(2) { [0]=> int(370) [1]=> string(1) " " } [6]=> array(2) { [0]=> int(307) [1]=> string(4) "true" } [7]=> string(1) "]" } string(25) "T_ENCAPSED_AND_WHITESPACE"
Output for 5.0.0 - 5.0.5
array(8) { [0]=> array(2) { [0]=> int(365) [1]=> string(6) "<?php " } [1]=> string(1) "[" [2]=> array(2) { [0]=> int(304) [1]=> string(1) "1" } [3]=> array(2) { [0]=> int(368) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(355) [1]=> string(2) "=>" } [5]=> array(2) { [0]=> int(368) [1]=> string(1) " " } [6]=> array(2) { [0]=> int(306) [1]=> string(4) "true" } [7]=> string(1) "]" } string(26) "T_CONSTANT_ENCAPSED_STRING"
Output for 4.4.2 - 4.4.9
array(8) { [0]=> array(2) { [0]=> int(354) [1]=> string(6) "<?php " } [1]=> string(1) "[" [2]=> array(2) { [0]=> int(303) [1]=> string(1) "1" } [3]=> array(2) { [0]=> int(357) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(345) [1]=> string(2) "=>" } [5]=> array(2) { [0]=> int(357) [1]=> string(1) " " } [6]=> array(2) { [0]=> int(305) [1]=> string(4) "true" } [7]=> string(1) "]" } string(6) "T_ECHO"
Output for 4.3.0 - 4.4.1
array(8) { [0]=> array(2) { [0]=> int(353) [1]=> string(6) "<?php " } [1]=> string(1) "[" [2]=> array(2) { [0]=> int(302) [1]=> string(1) "1" } [3]=> array(2) { [0]=> int(356) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(344) [1]=> string(2) "=>" } [5]=> array(2) { [0]=> int(356) [1]=> string(1) " " } [6]=> array(2) { [0]=> int(304) [1]=> string(4) "true" } [7]=> string(1) "]" } string(4) "T_DO"