3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "The 'Wee, inline callables are sort of function things' "; class q {function foo($str) {return 'moo '.$str; } } var_dump(([new q, 'foo'])('cow')); echo "The 'Wow, we can just quote anything now'"; function bar( ) { return 'cow'; } var_dump('bar'( )); echo "The 'I'm amazed PHP doesn't mess this up' "; foreach ($Array = [[12 => 'Moo'], [13 => 'Cow']] as $Array) { var_dump($Array); } echo "The 'PHP Variables MUST NOT contain some symbols... for very soft values of MUST NOT' "; ${'$0a'} = 12; ${'0a'} = 13; var_dump(${'$0a'}); var_dump(${'0a'}); // $0a is invalid and $$0a is even more invalid, with spinkles echo "The 'Good luck and thanks for all the cows' "; @var_dump(0x2&${$Array=['cow'=>3]}['cow']); echo "The 'Hurrah BC breaks, if your program broke because of this you're a bad person' "; list($a[],$a[])=$a=[1,2]; var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
The 'Wee, inline callables are sort of function things' string(7) "moo cow" The 'Wow, we can just quote anything now'string(3) "cow" The 'I'm amazed PHP doesn't mess this up' array(1) { [12]=> string(3) "Moo" } array(1) { [13]=> string(3) "Cow" } The 'PHP Variables MUST NOT contain some symbols... for very soft values of MUST NOT' int(12) int(13) The 'Good luck and thanks for all the cows' int(2) The 'Hurrah BC breaks, if your program broke because of this you're a bad person' array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(1) [3]=> int(2) }

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