3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(token_get_all(<<<EOD <?php \$string['message'] = 'construction'; \$text = "this is a \${string['message']} that is valid".PHP_EOL; echo \$text; EOD ));
based on 7TqOI
Output for 7.0.0 - 7.2.0
array(35) { [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(320) [1]=> string(7) "$string" [2]=> int(3) } [3]=> string(1) "[" [4]=> array(3) { [0]=> int(323) [1]=> string(9) "'message'" [2]=> int(3) } [5]=> string(1) "]" [6]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [7]=> string(1) "=" [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(323) [1]=> string(14) "'construction'" [2]=> int(3) } [10]=> string(1) ";" [11]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [12]=> array(3) { [0]=> int(320) [1]=> string(5) "$text" [2]=> int(4) } [13]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [14]=> string(1) "=" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [16]=> string(1) """ [17]=> array(3) { [0]=> int(322) [1]=> string(10) "this is a " [2]=> int(4) } [18]=> array(3) { [0]=> int(385) [1]=> string(2) "${" [2]=> int(4) } [19]=> array(3) { [0]=> int(324) [1]=> string(6) "string" [2]=> int(4) } [20]=> string(1) "[" [21]=> array(3) { [0]=> int(323) [1]=> string(9) "'message'" [2]=> int(4) } [22]=> string(1) "]" [23]=> string(1) "}" [24]=> array(3) { [0]=> int(322) [1]=> string(14) " that is valid" [2]=> int(4) } [25]=> string(1) """ [26]=> string(1) "." [27]=> array(3) { [0]=> int(319) [1]=> string(7) "PHP_EOL" [2]=> int(4) } [28]=> string(1) ";" [29]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [30]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(5) } [31]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } [32]=> array(3) { [0]=> int(320) [1]=> string(5) "$text" [2]=> int(5) } [33]=> string(1) ";" [34]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } }
Output for 5.6.8 - 5.6.28
array(35) { [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(312) [1]=> string(7) "$string" [2]=> int(3) } [3]=> string(1) "[" [4]=> array(3) { [0]=> int(318) [1]=> string(9) "'message'" [2]=> int(3) } [5]=> string(1) "]" [6]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [7]=> string(1) "=" [8]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(318) [1]=> string(14) "'construction'" [2]=> int(3) } [10]=> string(1) ";" [11]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [12]=> array(3) { [0]=> int(312) [1]=> string(5) "$text" [2]=> int(4) } [13]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [14]=> string(1) "=" [15]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [16]=> string(1) """ [17]=> array(3) { [0]=> int(317) [1]=> string(10) "this is a " [2]=> int(4) } [18]=> array(3) { [0]=> int(382) [1]=> string(2) "${" [2]=> int(4) } [19]=> array(3) { [0]=> int(311) [1]=> string(6) "string" [2]=> int(4) } [20]=> string(1) "[" [21]=> array(3) { [0]=> int(318) [1]=> string(9) "'message'" [2]=> int(4) } [22]=> string(1) "]" [23]=> string(1) "}" [24]=> array(3) { [0]=> int(317) [1]=> string(14) " that is valid" [2]=> int(4) } [25]=> string(1) """ [26]=> string(1) "." [27]=> array(3) { [0]=> int(310) [1]=> string(7) "PHP_EOL" [2]=> int(4) } [28]=> string(1) ";" [29]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [30]=> array(3) { [0]=> int(319) [1]=> string(4) "echo" [2]=> int(5) } [31]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(5) } [32]=> array(3) { [0]=> int(312) [1]=> string(5) "$text" [2]=> int(5) } [33]=> string(1) ";" [34]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(5) } }
Output for 5.5.24 - 5.5.35
array(35) { [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(310) [1]=> string(7) "$string" [2]=> int(3) } [3]=> string(1) "[" [4]=> array(3) { [0]=> int(316) [1]=> string(9) "'message'" [2]=> int(3) } [5]=> string(1) "]" [6]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [7]=> string(1) "=" [8]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(316) [1]=> string(14) "'construction'" [2]=> int(3) } [10]=> string(1) ";" [11]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [12]=> array(3) { [0]=> int(310) [1]=> string(5) "$text" [2]=> int(4) } [13]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [14]=> string(1) "=" [15]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [16]=> string(1) """ [17]=> array(3) { [0]=> int(315) [1]=> string(10) "this is a " [2]=> int(4) } [18]=> array(3) { [0]=> int(380) [1]=> string(2) "${" [2]=> int(4) } [19]=> array(3) { [0]=> int(309) [1]=> string(6) "string" [2]=> int(4) } [20]=> string(1) "[" [21]=> array(3) { [0]=> int(316) [1]=> string(9) "'message'" [2]=> int(4) } [22]=> string(1) "]" [23]=> string(1) "}" [24]=> array(3) { [0]=> int(315) [1]=> string(14) " that is valid" [2]=> int(4) } [25]=> string(1) """ [26]=> string(1) "." [27]=> array(3) { [0]=> int(308) [1]=> string(7) "PHP_EOL" [2]=> int(4) } [28]=> string(1) ";" [29]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [30]=> array(3) { [0]=> int(317) [1]=> string(4) "echo" [2]=> int(5) } [31]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(5) } [32]=> array(3) { [0]=> int(310) [1]=> string(5) "$text" [2]=> int(5) } [33]=> string(1) ";" [34]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(5) } }
Output for 5.4.0 - 5.4.45
array(35) { [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(309) [1]=> string(7) "$string" [2]=> int(3) } [3]=> string(1) "[" [4]=> array(3) { [0]=> int(315) [1]=> string(9) "'message'" [2]=> int(3) } [5]=> string(1) "]" [6]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [7]=> string(1) "=" [8]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(315) [1]=> string(14) "'construction'" [2]=> int(3) } [10]=> string(1) ";" [11]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [12]=> array(3) { [0]=> int(309) [1]=> string(5) "$text" [2]=> int(4) } [13]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [14]=> string(1) "=" [15]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [16]=> string(1) """ [17]=> array(3) { [0]=> int(314) [1]=> string(10) "this is a " [2]=> int(4) } [18]=> array(3) { [0]=> int(378) [1]=> string(2) "${" [2]=> int(4) } [19]=> array(3) { [0]=> int(308) [1]=> string(6) "string" [2]=> int(4) } [20]=> string(1) "[" [21]=> array(3) { [0]=> int(315) [1]=> string(9) "'message'" [2]=> int(4) } [22]=> string(1) "]" [23]=> string(1) "}" [24]=> array(3) { [0]=> int(314) [1]=> string(14) " that is valid" [2]=> int(4) } [25]=> string(1) """ [26]=> string(1) "." [27]=> array(3) { [0]=> int(307) [1]=> string(7) "PHP_EOL" [2]=> int(4) } [28]=> string(1) ";" [29]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [30]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(5) } [31]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(5) } [32]=> array(3) { [0]=> int(309) [1]=> string(5) "$text" [2]=> int(5) } [33]=> string(1) ";" [34]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(5) } }
Output for 5.3.19 - 5.3.29
array(35) { [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(309) [1]=> string(7) "$string" [2]=> int(3) } [3]=> string(1) "[" [4]=> array(3) { [0]=> int(315) [1]=> string(9) "'message'" [2]=> int(3) } [5]=> string(1) "]" [6]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [7]=> string(1) "=" [8]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(315) [1]=> string(14) "'construction'" [2]=> int(3) } [10]=> string(1) ";" [11]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [12]=> array(3) { [0]=> int(309) [1]=> string(5) "$text" [2]=> int(4) } [13]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [14]=> string(1) "=" [15]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [16]=> string(1) """ [17]=> array(3) { [0]=> int(314) [1]=> string(10) "this is a " [2]=> int(4) } [18]=> array(3) { [0]=> int(374) [1]=> string(2) "${" [2]=> int(4) } [19]=> array(3) { [0]=> int(308) [1]=> string(6) "string" [2]=> int(4) } [20]=> string(1) "[" [21]=> array(3) { [0]=> int(315) [1]=> string(9) "'message'" [2]=> int(4) } [22]=> string(1) "]" [23]=> string(1) "}" [24]=> array(3) { [0]=> int(314) [1]=> string(14) " that is valid" [2]=> int(4) } [25]=> string(1) """ [26]=> string(1) "." [27]=> array(3) { [0]=> int(307) [1]=> string(7) "PHP_EOL" [2]=> int(4) } [28]=> string(1) ";" [29]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [30]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(5) } [31]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(5) } [32]=> array(3) { [0]=> int(309) [1]=> string(5) "$text" [2]=> int(5) } [33]=> string(1) ";" [34]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(5) } }