3v4l.org

run code in 300+ PHP versions simultaneously
<?php for($i=0; $i<3; $i++) { echo $i; // 1, 2, 3 foreach($something as $value) { echo $i; // 0 foreach($value as $moreSomething) { echo $i; // 0 $object->addStuff($i, $moreSomething); // i = 0, moreSomething is correct } } }
Output for git.master, git.master_jit, rfc.property-hooks
0 Warning: Undefined variable $something in /in/aKikA on line 5 Warning: foreach() argument must be of type array|object, null given in /in/aKikA on line 5 1 Warning: Undefined variable $something in /in/aKikA on line 5 Warning: foreach() argument must be of type array|object, null given in /in/aKikA on line 5 2 Warning: Undefined variable $something in /in/aKikA on line 5 Warning: foreach() argument must be of type array|object, null given in /in/aKikA on line 5

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