3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = token_get_all(" <?php class Foo { function __halt_compiler(){} } (new Foo())->__halt_compiler(); not_html(); " ); var_dump($tokens); array_walk($tokens, function($tk) { if(is_array($tk)) { if(($t = token_name($tk[0])) == 'T_WHITESPACE') return; echo "L{$tk[2]}: ".$t." {$tk[1]}", PHP_EOL; } else echo $tk, PHP_EOL; });
Output for git.master, git.master_jit
array(16) { [0]=> array(3) { [0]=> int(318) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(394) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(3) } [3]=> array(3) { [0]=> int(369) [1]=> string(5) "class" [2]=> int(4) } [4]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(4) } [5]=> array(3) { [0]=> int(313) [1]=> string(3) "Foo" [2]=> int(4) } [6]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(4) } [7]=> string(1) "{" [8]=> array(3) { [0]=> int(397) [1]=> string(5) " " [2]=> int(4) } [9]=> array(3) { [0]=> int(347) [1]=> string(8) "function" [2]=> int(5) } [10]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(5) } [11]=> array(3) { [0]=> int(368) [1]=> string(15) "__halt_compiler" [2]=> int(5) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> string(1) "{" [15]=> array(3) { [0]=> int(318) [1]=> string(51) "} } (new Foo())->__halt_compiler(); not_html(); " [2]=> int(5) } } L1: T_INLINE_HTML L2: T_OPEN_TAG <?php L4: T_CLASS class L4: T_STRING Foo { L5: T_FUNCTION function L5: T_HALT_COMPILER __halt_compiler ( ) { L5: T_INLINE_HTML } } (new Foo())->__halt_compiler(); not_html();
Output for rfc.property-hooks
array(16) { [0]=> array(3) { [0]=> int(318) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(396) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(3) } [3]=> array(3) { [0]=> int(370) [1]=> string(5) "class" [2]=> int(4) } [4]=> array(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(4) } [5]=> array(3) { [0]=> int(313) [1]=> string(3) "Foo" [2]=> int(4) } [6]=> array(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(4) } [7]=> string(1) "{" [8]=> array(3) { [0]=> int(399) [1]=> string(5) " " [2]=> int(4) } [9]=> array(3) { [0]=> int(348) [1]=> string(8) "function" [2]=> int(5) } [10]=> array(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(5) } [11]=> array(3) { [0]=> int(369) [1]=> string(15) "__halt_compiler" [2]=> int(5) } [12]=> string(1) "(" [13]=> string(1) ")" [14]=> string(1) "{" [15]=> array(3) { [0]=> int(318) [1]=> string(51) "} } (new Foo())->__halt_compiler(); not_html(); " [2]=> int(5) } } L1: T_INLINE_HTML L2: T_OPEN_TAG <?php L4: T_CLASS class L4: T_STRING Foo { L5: T_FUNCTION function L5: T_HALT_COMPILER __halt_compiler ( ) { L5: T_INLINE_HTML } } (new Foo())->__halt_compiler(); not_html();

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
64.83 ms | 405 KiB | 8 Q