3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump( token_get_all( <<<'EOT' <?php echo 'foo ' . $bar . ' qux' . "\n"; echo "foo $bar qux\n"; EOT ) );
Output for 7.0.0 - 7.1.0
array(27) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(2) } [2]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [3]=> array(3) { [0]=> int(323) [1]=> string(6) "'foo '" [2]=> int(2) } [4]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [5]=> string(1) "." [6]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(320) [1]=> string(4) "$bar" [2]=> int(2) } [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [9]=> string(1) "." [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [11]=> array(3) { [0]=> int(323) [1]=> string(6) "' qux'" [2]=> int(2) } [12]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [13]=> string(1) "." [14]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [15]=> array(3) { [0]=> int(323) [1]=> string(4) ""\n"" [2]=> int(2) } [16]=> string(1) ";" [17]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(2) } [18]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(3) } [19]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [20]=> string(1) """ [21]=> array(3) { [0]=> int(322) [1]=> string(4) "foo " [2]=> int(3) } [22]=> array(3) { [0]=> int(320) [1]=> string(4) "$bar" [2]=> int(3) } [23]=> array(3) { [0]=> int(322) [1]=> string(6) " qux\n" [2]=> int(3) } [24]=> string(1) """ [25]=> string(1) ";" [26]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } }
Output for 5.6.0 - 5.6.28
array(27) { [0]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(319) [1]=> string(4) "echo" [2]=> int(2) } [2]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [3]=> array(3) { [0]=> int(318) [1]=> string(6) "'foo '" [2]=> int(2) } [4]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [5]=> string(1) "." [6]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(312) [1]=> string(4) "$bar" [2]=> int(2) } [8]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [9]=> string(1) "." [10]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [11]=> array(3) { [0]=> int(318) [1]=> string(6) "' qux'" [2]=> int(2) } [12]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [13]=> string(1) "." [14]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [15]=> array(3) { [0]=> int(318) [1]=> string(4) ""\n"" [2]=> int(2) } [16]=> string(1) ";" [17]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(2) } [18]=> array(3) { [0]=> int(319) [1]=> string(4) "echo" [2]=> int(3) } [19]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [20]=> string(1) """ [21]=> array(3) { [0]=> int(317) [1]=> string(4) "foo " [2]=> int(3) } [22]=> array(3) { [0]=> int(312) [1]=> string(4) "$bar" [2]=> int(3) } [23]=> array(3) { [0]=> int(317) [1]=> string(6) " qux\n" [2]=> int(3) } [24]=> string(1) """ [25]=> string(1) ";" [26]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } }
Output for 5.5.0 - 5.5.38
array(27) { [0]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(317) [1]=> string(4) "echo" [2]=> int(2) } [2]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [3]=> array(3) { [0]=> int(316) [1]=> string(6) "'foo '" [2]=> int(2) } [4]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [5]=> string(1) "." [6]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(310) [1]=> string(4) "$bar" [2]=> int(2) } [8]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [9]=> string(1) "." [10]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [11]=> array(3) { [0]=> int(316) [1]=> string(6) "' qux'" [2]=> int(2) } [12]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [13]=> string(1) "." [14]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [15]=> array(3) { [0]=> int(316) [1]=> string(4) ""\n"" [2]=> int(2) } [16]=> string(1) ";" [17]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(2) } [18]=> array(3) { [0]=> int(317) [1]=> string(4) "echo" [2]=> int(3) } [19]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [20]=> string(1) """ [21]=> array(3) { [0]=> int(315) [1]=> string(4) "foo " [2]=> int(3) } [22]=> array(3) { [0]=> int(310) [1]=> string(4) "$bar" [2]=> int(3) } [23]=> array(3) { [0]=> int(315) [1]=> string(6) " qux\n" [2]=> int(3) } [24]=> string(1) """ [25]=> string(1) ";" [26]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } }
Output for 5.4.0 - 5.4.45
array(27) { [0]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(2) } [2]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [3]=> array(3) { [0]=> int(315) [1]=> string(6) "'foo '" [2]=> int(2) } [4]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [5]=> string(1) "." [6]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(309) [1]=> string(4) "$bar" [2]=> int(2) } [8]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [9]=> string(1) "." [10]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [11]=> array(3) { [0]=> int(315) [1]=> string(6) "' qux'" [2]=> int(2) } [12]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [13]=> string(1) "." [14]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [15]=> array(3) { [0]=> int(315) [1]=> string(4) ""\n"" [2]=> int(2) } [16]=> string(1) ";" [17]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(2) } [18]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(3) } [19]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [20]=> string(1) """ [21]=> array(3) { [0]=> int(314) [1]=> string(4) "foo " [2]=> int(3) } [22]=> array(3) { [0]=> int(309) [1]=> string(4) "$bar" [2]=> int(3) } [23]=> array(3) { [0]=> int(314) [1]=> string(6) " qux\n" [2]=> int(3) } [24]=> string(1) """ [25]=> string(1) ";" [26]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } }
Output for 5.3.0 - 5.3.29
array(27) { [0]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(2) } [2]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [3]=> array(3) { [0]=> int(315) [1]=> string(6) "'foo '" [2]=> int(2) } [4]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [5]=> string(1) "." [6]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [7]=> array(3) { [0]=> int(309) [1]=> string(4) "$bar" [2]=> int(2) } [8]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [9]=> string(1) "." [10]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [11]=> array(3) { [0]=> int(315) [1]=> string(6) "' qux'" [2]=> int(2) } [12]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [13]=> string(1) "." [14]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [15]=> array(3) { [0]=> int(315) [1]=> string(4) ""\n"" [2]=> int(2) } [16]=> string(1) ";" [17]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(2) } [18]=> array(3) { [0]=> int(316) [1]=> string(4) "echo" [2]=> int(3) } [19]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [20]=> string(1) """ [21]=> array(3) { [0]=> int(314) [1]=> string(4) "foo " [2]=> int(3) } [22]=> array(3) { [0]=> int(309) [1]=> string(4) "$bar" [2]=> int(3) } [23]=> array(3) { [0]=> int(314) [1]=> string(6) " qux\n" [2]=> int(3) } [24]=> string(1) """ [25]=> string(1) ";" [26]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_SL, expecting ')' in /in/arW8A on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_SL, expecting ')' in /in/arW8A on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/arW8A on line 4
Process exited with code 255.