3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(token_get_all('<?php interface Foo { public function boo(): \Goo\Hoo;}', TOKEN_PARSE));
based on 2USo7
Output for 7.0.0 - 7.1.0, 7.2.0
array(22) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(363) [1]=> string(9) "interface" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(319) [1]=> string(3) "Foo" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(316) [1]=> string(6) "public" [2]=> int(1) } [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [9]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(1) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [11]=> array(3) { [0]=> int(319) [1]=> string(3) "boo" [2]=> int(1) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> string(1) ":" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [16]=> array(3) { [0]=> int(390) [1]=> string(1) "\" [2]=> int(1) } [17]=> array(3) { [0]=> int(319) [1]=> string(3) "Goo" [2]=> int(1) } [18]=> array(3) { [0]=> int(390) [1]=> string(1) "\" [2]=> int(1) } [19]=> array(3) { [0]=> int(319) [1]=> string(3) "Hoo" [2]=> int(1) } [20]=> string(1) ";" [21]=> string(1) "}" }
Output for 7.1.5 - 7.1.10
array(22) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(363) [1]=> string(9) "interface" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(319) [1]=> string(3) "Foo" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(311) [1]=> string(6) "public" [2]=> int(1) } [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [9]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(1) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [11]=> array(3) { [0]=> int(319) [1]=> string(3) "boo" [2]=> int(1) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> string(1) ":" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [16]=> array(3) { [0]=> int(390) [1]=> string(1) "\" [2]=> int(1) } [17]=> array(3) { [0]=> int(319) [1]=> string(3) "Goo" [2]=> int(1) } [18]=> array(3) { [0]=> int(390) [1]=> string(1) "\" [2]=> int(1) } [19]=> array(3) { [0]=> int(319) [1]=> string(3) "Hoo" [2]=> int(1) } [20]=> string(1) ";" [21]=> string(1) "}" }
Output for 5.3.21 - 5.6.28
Notice: Use of undefined constant TOKEN_PARSE - assumed 'TOKEN_PARSE' in /in/09i9Z on line 3 Warning: token_get_all() expects exactly 1 parameter, 2 given in /in/09i9Z on line 3 NULL