3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $php = "<?php class A { static function class() { return A::class; } } "; var_dump(token_get_all($php));
based on dI8pR
Output for 7.0.0 - 7.1.0, 7.2.0
array(28) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(319) [1]=> string(1) "A" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(382) [1]=> string(9) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(311) [1]=> string(6) "static" [2]=> int(3) } [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(3) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [11]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(3) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [15]=> string(1) "{" [16]=> array(3) { [0]=> int(382) [1]=> string(13) " " [2]=> int(3) } [17]=> array(3) { [0]=> int(348) [1]=> string(6) "return" [2]=> int(4) } [18]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [19]=> array(3) { [0]=> int(319) [1]=> string(1) "A" [2]=> int(4) } [20]=> array(3) { [0]=> int(387) [1]=> string(2) "::" [2]=> int(4) } [21]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(4) } [22]=> string(1) ";" [23]=> array(3) { [0]=> int(382) [1]=> string(9) " " [2]=> int(4) } [24]=> string(1) "}" [25]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(5) } [26]=> string(1) "}" [27]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(6) } }
Output for 7.1.5 - 7.1.10
array(28) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(1) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(319) [1]=> string(1) "A" [2]=> int(1) } [4]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(382) [1]=> string(9) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(316) [1]=> string(6) "static" [2]=> int(3) } [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(3) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [11]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(3) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [15]=> string(1) "{" [16]=> array(3) { [0]=> int(382) [1]=> string(13) " " [2]=> int(3) } [17]=> array(3) { [0]=> int(348) [1]=> string(6) "return" [2]=> int(4) } [18]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [19]=> array(3) { [0]=> int(319) [1]=> string(1) "A" [2]=> int(4) } [20]=> array(3) { [0]=> int(387) [1]=> string(2) "::" [2]=> int(4) } [21]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(4) } [22]=> string(1) ";" [23]=> array(3) { [0]=> int(382) [1]=> string(9) " " [2]=> int(4) } [24]=> string(1) "}" [25]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(5) } [26]=> string(1) "}" [27]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(6) } }
Output for 5.6.0 - 5.6.28
array(28) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(1) } [2]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(310) [1]=> string(1) "A" [2]=> int(1) } [4]=> array(3) { [0]=> int(379) [1]=> string(5) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(379) [1]=> string(9) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(352) [1]=> string(6) "static" [2]=> int(3) } [8]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(337) [1]=> string(8) "function" [2]=> int(3) } [10]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [11]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(3) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [15]=> string(1) "{" [16]=> array(3) { [0]=> int(379) [1]=> string(13) " " [2]=> int(3) } [17]=> array(3) { [0]=> int(339) [1]=> string(6) "return" [2]=> int(4) } [18]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [19]=> array(3) { [0]=> int(310) [1]=> string(1) "A" [2]=> int(4) } [20]=> array(3) { [0]=> int(384) [1]=> string(2) "::" [2]=> int(4) } [21]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(4) } [22]=> string(1) ";" [23]=> array(3) { [0]=> int(379) [1]=> string(9) " " [2]=> int(4) } [24]=> string(1) "}" [25]=> array(3) { [0]=> int(379) [1]=> string(5) " " [2]=> int(5) } [26]=> string(1) "}" [27]=> array(3) { [0]=> int(379) [1]=> string(5) " " [2]=> int(6) } }
Output for 5.5.0 - 5.5.38
array(28) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(1) } [2]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(308) [1]=> string(1) "A" [2]=> int(1) } [4]=> array(3) { [0]=> int(377) [1]=> string(5) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(377) [1]=> string(9) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(350) [1]=> string(6) "static" [2]=> int(3) } [8]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(335) [1]=> string(8) "function" [2]=> int(3) } [10]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [11]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(3) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [15]=> string(1) "{" [16]=> array(3) { [0]=> int(377) [1]=> string(13) " " [2]=> int(3) } [17]=> array(3) { [0]=> int(337) [1]=> string(6) "return" [2]=> int(4) } [18]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [19]=> array(3) { [0]=> int(308) [1]=> string(1) "A" [2]=> int(4) } [20]=> array(3) { [0]=> int(382) [1]=> string(2) "::" [2]=> int(4) } [21]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(4) } [22]=> string(1) ";" [23]=> array(3) { [0]=> int(377) [1]=> string(9) " " [2]=> int(4) } [24]=> string(1) "}" [25]=> array(3) { [0]=> int(377) [1]=> string(5) " " [2]=> int(5) } [26]=> string(1) "}" [27]=> array(3) { [0]=> int(377) [1]=> string(5) " " [2]=> int(6) } }
Output for 5.4.0 - 5.4.45
array(28) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(1) } [2]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(1) } [3]=> array(3) { [0]=> int(307) [1]=> string(1) "A" [2]=> int(1) } [4]=> array(3) { [0]=> int(375) [1]=> string(5) " " [2]=> int(1) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(375) [1]=> string(9) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(348) [1]=> string(6) "static" [2]=> int(3) } [8]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(334) [1]=> string(8) "function" [2]=> int(3) } [10]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [11]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(3) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [15]=> string(1) "{" [16]=> array(3) { [0]=> int(375) [1]=> string(13) " " [2]=> int(3) } [17]=> array(3) { [0]=> int(336) [1]=> string(6) "return" [2]=> int(4) } [18]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [19]=> array(3) { [0]=> int(307) [1]=> string(1) "A" [2]=> int(4) } [20]=> array(3) { [0]=> int(380) [1]=> string(2) "::" [2]=> int(4) } [21]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(4) } [22]=> string(1) ";" [23]=> array(3) { [0]=> int(375) [1]=> string(9) " " [2]=> int(4) } [24]=> string(1) "}" [25]=> array(3) { [0]=> int(375) [1]=> string(5) " " [2]=> int(5) } [26]=> string(1) "}" [27]=> array(3) { [0]=> int(375) [1]=> string(5) " " [2]=> int(6) } }