3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(T_COMMENT, token_get_all('<?php echo "test"; // Ceci est un test'));
Output for 7.0.0 - 7.2.0
int(377) array(7) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(323) [1]=> string(6) ""test"" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(377) [1]=> string(19) "// Ceci est un test" [2]=> int(1) } }
Output for 5.6.8 - 5.6.28
int(374) array(7) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(319) [1]=> string(4) "echo" [2]=> int(1) } [2]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(318) [1]=> string(6) ""test"" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(374) [1]=> string(19) "// Ceci est un test" [2]=> int(1) } }
Output for 5.5.24 - 5.5.35
int(372) array(7) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(317) [1]=> string(4) "echo" [2]=> int(1) } [2]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(316) [1]=> string(6) ""test"" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(372) [1]=> string(19) "// Ceci est un test" [2]=> int(1) } }
Output for 5.4.0 - 5.4.45
int(370) array(7) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(1) } [2]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(315) [1]=> string(6) ""test"" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(370) [1]=> string(19) "// Ceci est un test" [2]=> int(1) } }
Output for 5.3.19 - 5.3.29
int(366) array(7) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(1) } [2]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(315) [1]=> string(6) ""test"" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [6]=> array(3) { [0]=> int(366) [1]=> string(19) "// Ceci est un test" [2]=> int(1) } }