3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $source = <<< SOURCE <?php namespace Test { class Test { } } SOURCE; var_dump(token_get_all($source));
based on Qk5UH
Output for 7.0.0 - 7.2.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(388) [1]=> string(9) "namespace" [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]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(382) [1]=> string(2) " " [2]=> int(3) } [8]=> array(3) { [0]=> int(361) [1]=> string(5) "class" [2]=> int(5) } [9]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } [10]=> array(3) { [0]=> int(319) [1]=> string(4) "Test" [2]=> int(5) } [11]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } [12]=> string(1) "{" [13]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } [14]=> string(1) "}" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(7) } [16]=> string(1) "}" }
Output for 5.6.8 - 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(385) [1]=> string(9) "namespace" [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]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(379) [1]=> string(2) " " [2]=> int(3) } [8]=> array(3) { [0]=> int(358) [1]=> string(5) "class" [2]=> int(5) } [9]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(5) } [10]=> array(3) { [0]=> int(310) [1]=> string(4) "Test" [2]=> int(5) } [11]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(5) } [12]=> string(1) "{" [13]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(6) } [14]=> string(1) "}" [15]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(7) } [16]=> string(1) "}" }
Output for 5.5.24 - 5.5.35
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(383) [1]=> string(9) "namespace" [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]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(377) [1]=> string(2) " " [2]=> int(3) } [8]=> array(3) { [0]=> int(356) [1]=> string(5) "class" [2]=> int(5) } [9]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(5) } [10]=> array(3) { [0]=> int(308) [1]=> string(4) "Test" [2]=> int(5) } [11]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(5) } [12]=> string(1) "{" [13]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(6) } [14]=> string(1) "}" [15]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(7) } [16]=> string(1) "}" }
Output for 5.4.11 - 5.4.45
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(381) [1]=> string(9) "namespace" [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]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(375) [1]=> string(2) " " [2]=> int(3) } [8]=> array(3) { [0]=> int(354) [1]=> string(5) "class" [2]=> int(5) } [9]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(5) } [10]=> array(3) { [0]=> int(307) [1]=> string(4) "Test" [2]=> int(5) } [11]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(5) } [12]=> string(1) "{" [13]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(6) } [14]=> string(1) "}" [15]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(7) } [16]=> string(1) "}" }
Output for 5.3.21 - 5.3.29
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(377) [1]=> string(9) "namespace" [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]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [6]=> string(1) "{" [7]=> array(3) { [0]=> int(371) [1]=> string(2) " " [2]=> int(3) } [8]=> array(3) { [0]=> int(353) [1]=> string(5) "class" [2]=> int(5) } [9]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(5) } [10]=> array(3) { [0]=> int(307) [1]=> string(4) "Test" [2]=> int(5) } [11]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(5) } [12]=> string(1) "{" [13]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(6) } [14]=> string(1) "}" [15]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(7) } [16]=> string(1) "}" }