3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "<?php\n class test{\n }\n \n someclasss::method('Class not found');\n "; var_dump( token_get_all( $str ) );
Output for 7.0.4 - 7.1.0
array(17) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(319) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(382) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(382) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(319) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(387) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(319) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(323) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(382) [1]=> string(2) " " [2]=> int(9) } }
Output for hhvm-3.12.0
array(17) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(353) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(371) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(371) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(307) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(426) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(307) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(315) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(371) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.6.18 - 5.6.28
array(17) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(310) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(379) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(379) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(310) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(384) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(310) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(318) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(379) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.5.0 - 5.5.38
array(17) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(308) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(377) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(377) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(308) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(382) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(308) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(316) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(377) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.4.0 - 5.4.18
array(17) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(375) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(375) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(307) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(380) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(307) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(315) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(375) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.3.0 - 5.3.27
array(17) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(353) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(371) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(371) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(307) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(376) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(307) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(315) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(371) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.2.2 - 5.2.17
array(17) { [0]=> array(3) { [0]=> int(367) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(370) [1]=> string(1) " " [2]=> int(2) } [2]=> array(3) { [0]=> int(352) [1]=> string(5) "class" [2]=> int(3) } [3]=> array(3) { [0]=> int(370) [1]=> string(1) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(307) [1]=> string(4) "test" [2]=> int(3) } [5]=> string(1) "{" [6]=> array(3) { [0]=> int(370) [1]=> string(2) " " [2]=> int(3) } [7]=> string(1) "}" [8]=> array(3) { [0]=> int(370) [1]=> string(4) " " [2]=> int(5) } [9]=> array(3) { [0]=> int(307) [1]=> string(10) "someclasss" [2]=> int(9) } [10]=> array(3) { [0]=> int(375) [1]=> string(2) "::" [2]=> int(9) } [11]=> array(3) { [0]=> int(307) [1]=> string(6) "method" [2]=> int(9) } [12]=> string(1) "(" [13]=> array(3) { [0]=> int(315) [1]=> string(17) "'Class not found'" [2]=> int(9) } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(3) { [0]=> int(370) [1]=> string(2) " " [2]=> int(9) } }
Output for 5.1.0 - 5.2.1
array(17) { [0]=> array(2) { [0]=> int(367) [1]=> string(6) "<?php " } [1]=> array(2) { [0]=> int(370) [1]=> string(1) " " } [2]=> array(2) { [0]=> int(352) [1]=> string(5) "class" } [3]=> array(2) { [0]=> int(370) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(307) [1]=> string(4) "test" } [5]=> string(1) "{" [6]=> array(2) { [0]=> int(370) [1]=> string(2) " " } [7]=> string(1) "}" [8]=> array(2) { [0]=> int(370) [1]=> string(4) " " } [9]=> array(2) { [0]=> int(307) [1]=> string(10) "someclasss" } [10]=> array(2) { [0]=> int(375) [1]=> string(2) "::" } [11]=> array(2) { [0]=> int(307) [1]=> string(6) "method" } [12]=> string(1) "(" [13]=> array(2) { [0]=> int(315) [1]=> string(17) "'Class not found'" } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(2) { [0]=> int(370) [1]=> string(2) " " } }
Output for 5.0.0 - 5.0.5
array(17) { [0]=> array(2) { [0]=> int(365) [1]=> string(6) "<?php " } [1]=> array(2) { [0]=> int(368) [1]=> string(1) " " } [2]=> array(2) { [0]=> int(350) [1]=> string(5) "class" } [3]=> array(2) { [0]=> int(368) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(306) [1]=> string(4) "test" } [5]=> string(1) "{" [6]=> array(2) { [0]=> int(368) [1]=> string(2) " " } [7]=> string(1) "}" [8]=> array(2) { [0]=> int(368) [1]=> string(4) " " } [9]=> array(2) { [0]=> int(306) [1]=> string(10) "someclasss" } [10]=> array(2) { [0]=> int(373) [1]=> string(2) "::" } [11]=> array(2) { [0]=> int(306) [1]=> string(6) "method" } [12]=> string(1) "(" [13]=> array(2) { [0]=> int(314) [1]=> string(17) "'Class not found'" } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(2) { [0]=> int(368) [1]=> string(2) " " } }
Output for 4.4.2 - 4.4.9
array(17) { [0]=> array(2) { [0]=> int(354) [1]=> string(6) "<?php " } [1]=> array(2) { [0]=> int(357) [1]=> string(1) " " } [2]=> array(2) { [0]=> int(342) [1]=> string(5) "class" } [3]=> array(2) { [0]=> int(357) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(305) [1]=> string(4) "test" } [5]=> string(1) "{" [6]=> array(2) { [0]=> int(357) [1]=> string(2) " " } [7]=> string(1) "}" [8]=> array(2) { [0]=> int(357) [1]=> string(4) " " } [9]=> array(2) { [0]=> int(305) [1]=> string(10) "someclasss" } [10]=> array(2) { [0]=> int(362) [1]=> string(2) "::" } [11]=> array(2) { [0]=> int(305) [1]=> string(6) "method" } [12]=> string(1) "(" [13]=> array(2) { [0]=> int(313) [1]=> string(17) "'Class not found'" } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(2) { [0]=> int(357) [1]=> string(2) " " } }
Output for 4.3.0 - 4.4.1
array(17) { [0]=> array(2) { [0]=> int(353) [1]=> string(6) "<?php " } [1]=> array(2) { [0]=> int(356) [1]=> string(1) " " } [2]=> array(2) { [0]=> int(341) [1]=> string(5) "class" } [3]=> array(2) { [0]=> int(356) [1]=> string(1) " " } [4]=> array(2) { [0]=> int(304) [1]=> string(4) "test" } [5]=> string(1) "{" [6]=> array(2) { [0]=> int(356) [1]=> string(2) " " } [7]=> string(1) "}" [8]=> array(2) { [0]=> int(356) [1]=> string(4) " " } [9]=> array(2) { [0]=> int(304) [1]=> string(10) "someclasss" } [10]=> array(2) { [0]=> int(361) [1]=> string(2) "::" } [11]=> array(2) { [0]=> int(304) [1]=> string(6) "method" } [12]=> string(1) "(" [13]=> array(2) { [0]=> int(312) [1]=> string(17) "'Class not found'" } [14]=> string(1) ")" [15]=> string(1) ";" [16]=> array(2) { [0]=> int(356) [1]=> string(2) " " } }