3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = "foo"; $bar = "bar"; // I do this if ($foo) echo "foo'd! \n"; else echo "no foo. \n"; // try not to do this if ($foo) if ($bar) echo "foo bar! \n"; else echo "not foo'd, maybe bar'd \n"; // I also do this $fooBars = [$foo, $bar]; foreach ($fooBars as $value) if ($value == $foo) echo "foo in a loop! \n"; // looking at it side by side... $fooBars = [$foo, $bar]; foreach ($fooBars as $value) { if ($value == $foo) { echo "foo in a loop!... with curly braces \n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
foo'd! foo bar! foo in a loop! foo in a loop!... with curly braces

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:
31.63 ms | 401 KiB | 8 Q