3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 2, 3]; echo "Foreach 1: "; foreach ($array as $value) echo $value; echo "\n"; echo "Foreach 2: "; foreach ($array as $value) echo $value; echo "\n"; echo "Each 1: "; while (list(, $value) = each($array)) echo $value; echo "\n"; echo "Each 2: "; while (list(, $value) = each($array)) echo $value; echo "\n"; echo "Reset/Each: "; reset($array); while (list(, $value) = each($array)) echo $value; echo "\n";
Output for git.master, git.master_jit, rfc.property-hooks
Foreach 1: 123 Foreach 2: 123 Each 1: Fatal error: Uncaught Error: Call to undefined function each() in /in/ncnBZ:14 Stack trace: #0 {main} thrown in /in/ncnBZ on line 14
Process exited with code 255.

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