3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code =<<<'EOF' <?php /** * @param string $content */ function strlen($content) { for ($len = 0; isset($content[$length]); $en++); return $len; } EOF; var_dump(token_get_all($code));
Output for 7.0.0 - 7.1.0, 7.1.12 - 7.3.0
array(43) { [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(378) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(319) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(320) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(332) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(320) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(317) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(358) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(320) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(320) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(320) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(295) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(382) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(348) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(320) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 7.1.1 - 7.1.11
array(43) { [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(378) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(346) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(319) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(320) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(382) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(332) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(320) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(317) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(358) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(320) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(320) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(320) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(303) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(382) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(348) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(320) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 5.6.0 - 5.6.38
array(43) { [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(375) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(337) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(310) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(312) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(379) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(323) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(312) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(308) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(355) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(312) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(312) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(312) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(299) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(379) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(339) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(312) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 5.5.0 - 5.5.38
array(43) { [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(373) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(335) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(308) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(310) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(377) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(321) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(310) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(306) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(353) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(310) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(310) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(310) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(298) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(377) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(337) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(310) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 5.4.0 - 5.4.45
array(43) { [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(371) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(334) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(307) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(309) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(375) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(320) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(309) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(305) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(351) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(309) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(309) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(309) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(297) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(375) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(336) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(309) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 5.3.0 - 5.3.29
array(43) { [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(367) [1]=> string(33) "/** * @param string $content */" [2]=> int(3) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(5) } [4]=> array(3) { [0]=> int(334) [1]=> string(8) "function" [2]=> int(6) } [5]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(6) } [6]=> array(3) { [0]=> int(307) [1]=> string(6) "strlen" [2]=> int(6) } [7]=> string(1) "(" [8]=> array(3) { [0]=> int(309) [1]=> string(8) "$content" [2]=> int(6) } [9]=> string(1) ")" [10]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(6) } [11]=> string(1) "{" [12]=> array(3) { [0]=> int(371) [1]=> string(5) " " [2]=> int(7) } [13]=> array(3) { [0]=> int(320) [1]=> string(3) "for" [2]=> int(8) } [14]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(8) } [15]=> string(1) "(" [16]=> array(3) { [0]=> int(309) [1]=> string(4) "$len" [2]=> int(8) } [17]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(8) } [18]=> string(1) "=" [19]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(8) } [20]=> array(3) { [0]=> int(305) [1]=> string(1) "0" [2]=> int(8) } [21]=> string(1) ";" [22]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(8) } [23]=> array(3) { [0]=> int(350) [1]=> string(5) "isset" [2]=> int(8) } [24]=> string(1) "(" [25]=> array(3) { [0]=> int(309) [1]=> string(8) "$content" [2]=> int(8) } [26]=> string(1) "[" [27]=> array(3) { [0]=> int(309) [1]=> string(7) "$length" [2]=> int(8) } [28]=> string(1) "]" [29]=> string(1) ")" [30]=> string(1) ";" [31]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(8) } [32]=> array(3) { [0]=> int(309) [1]=> string(3) "$en" [2]=> int(8) } [33]=> array(3) { [0]=> int(297) [1]=> string(2) "++" [2]=> int(8) } [34]=> string(1) ")" [35]=> string(1) ";" [36]=> array(3) { [0]=> int(371) [1]=> string(6) " " [2]=> int(8) } [37]=> array(3) { [0]=> int(336) [1]=> string(6) "return" [2]=> int(10) } [38]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(10) } [39]=> array(3) { [0]=> int(309) [1]=> string(4) "$len" [2]=> int(10) } [40]=> string(1) ";" [41]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(10) } [42]=> string(1) "}" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_SL in /in/UJ9ph on line 2
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 in /in/UJ9ph on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/UJ9ph on line 2
Process exited with code 255.