3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<?php print "$array[\'a\']";'; foreach (token_get_all($str) as $t) { if (is_array($t)) { $n = token_name($t[0]); $v = $t[1]; } else { $n = "(literal)"; $v = $t; } printf("%25s: %s\n", $n, var_export($v,TRUE)); }
Output for git.master, git.master_jit, rfc.property-hooks
T_OPEN_TAG: '<?php ' T_PRINT: 'print' T_WHITESPACE: ' ' (literal): '"' T_VARIABLE: '$array' (literal): '[' T_ENCAPSED_AND_WHITESPACE: '' T_ENCAPSED_AND_WHITESPACE: '\'a\']' (literal): '"' (literal): ';'

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:
28.63 ms | 402 KiB | 8 Q