3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emptyobject = new stdClass(); foreach ($emptyobject as $key => $value) { echo "Empty object: {$key} = {$value}\n"; } $filledobject = new stdClass(); $filledobject->foo = "foo"; $filledobject->bar = "bar"; foreach ($filledobject as $key => $value) { echo "Filled object: {$key} = {$value}\n"; } $string = "abc"; foreach ($string as $key => $value) { echo "String: {$key} = {$value}\n"; } $number = 123; foreach ($number as $key => $value) { echo "Number: {$key} = {$value}\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Filled object: foo = foo Filled object: bar = bar Warning: foreach() argument must be of type array|object, string given in /in/CCrFo on line 16 Warning: foreach() argument must be of type array|object, int given in /in/CCrFo on line 21

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:
38.55 ms | 406 KiB | 5 Q