3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(token_get_all('<?php class Foo { const PRIVATE = 0; } '));
based on 3BtXQ
Output for 7.0.0 - 7.1.0, 7.2.0
array(19) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(382) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(319) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(382) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(347) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(314) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(317) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(382) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } }
Output for 7.1.5 - 7.1.10
array(19) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(382) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(319) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(382) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(347) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(313) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(317) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(382) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } }
Output for 5.6.8 - 5.6.28
array(19) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(379) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(310) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(379) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(338) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(349) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(308) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(379) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(6) } }
Output for 5.5.24 - 5.5.35
array(19) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(377) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(308) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(377) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(336) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(347) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(306) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(377) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(6) } }
Output for 5.4.11 - 5.4.45
array(19) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(375) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(307) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(375) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(335) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(345) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(305) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(375) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(6) } }
Output for 5.3.21 - 5.3.29
array(19) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(371) [1]=> string(4) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(353) [1]=> string(5) "class" [2]=> int(2) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [4]=> array(3) { [0]=> int(307) [1]=> string(3) "Foo" [2]=> int(2) } [5]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(371) [1]=> string(18) " " [2]=> int(2) } [8]=> array(3) { [0]=> int(335) [1]=> string(5) "const" [2]=> int(4) } [9]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [10]=> array(3) { [0]=> int(344) [1]=> string(7) "PRIVATE" [2]=> int(4) } [11]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [12]=> string(1) "=" [13]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(305) [1]=> string(1) "0" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(371) [1]=> string(6) " " [2]=> int(4) } [17]=> string(1) "}" [18]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(6) } }