3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eval = '<?php function test($test, $toto, ) {} '; var_dump(token_get_all($eval));
based on cYaTn
Output for 7.0.0 - 7.2.0
array(16) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(319) [1]=> string(4) "test" [2]=> int(1) } [4]=> string(1) "(" [5]=> array(3) { [0]=> int(320) [1]=> string(5) "$test" [2]=> int(1) } [6]=> string(1) "," [7]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(320) [1]=> string(5) "$toto" [2]=> int(1) } [9]=> string(1) "," [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [11]=> string(1) ")" [12]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [13]=> string(1) "{" [14]=> string(1) "}" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } }
Output for 5.6.8 - 5.6.28
array(16) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(337) [1]=> string(8) "function" [2]=> int(1) } [2]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(310) [1]=> string(4) "test" [2]=> int(1) } [4]=> string(1) "(" [5]=> array(3) { [0]=> int(312) [1]=> string(5) "$test" [2]=> int(1) } [6]=> string(1) "," [7]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(312) [1]=> string(5) "$toto" [2]=> int(1) } [9]=> string(1) "," [10]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [11]=> string(1) ")" [12]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [13]=> string(1) "{" [14]=> string(1) "}" [15]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } }
Output for 5.5.24 - 5.5.35
array(16) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(335) [1]=> string(8) "function" [2]=> int(1) } [2]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(308) [1]=> string(4) "test" [2]=> int(1) } [4]=> string(1) "(" [5]=> array(3) { [0]=> int(310) [1]=> string(5) "$test" [2]=> int(1) } [6]=> string(1) "," [7]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(310) [1]=> string(5) "$toto" [2]=> int(1) } [9]=> string(1) "," [10]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [11]=> string(1) ")" [12]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [13]=> string(1) "{" [14]=> string(1) "}" [15]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } }
Output for 5.4.9 - 5.4.45
array(16) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(334) [1]=> string(8) "function" [2]=> int(1) } [2]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(1) } [4]=> string(1) "(" [5]=> array(3) { [0]=> int(309) [1]=> string(5) "$test" [2]=> int(1) } [6]=> string(1) "," [7]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(309) [1]=> string(5) "$toto" [2]=> int(1) } [9]=> string(1) "," [10]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [11]=> string(1) ")" [12]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [13]=> string(1) "{" [14]=> string(1) "}" [15]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } }
Output for 5.3.19 - 5.3.29
array(16) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(334) [1]=> string(8) "function" [2]=> int(1) } [2]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(1) } [4]=> string(1) "(" [5]=> array(3) { [0]=> int(309) [1]=> string(5) "$test" [2]=> int(1) } [6]=> string(1) "," [7]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [8]=> array(3) { [0]=> int(309) [1]=> string(5) "$toto" [2]=> int(1) } [9]=> string(1) "," [10]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [11]=> string(1) ")" [12]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } [13]=> string(1) "{" [14]=> string(1) "}" [15]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(1) } }