3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "one" => 1, "two" => 2, "three" => 3, "four" => 4 ]; while (($key = key($array)) !== null) { // check if the internal pointer points beyond the end of the elements list or the array is empty echo "$key => {$array[$key]}\n"; // display current key value pair if ($array[$key] < 3) { // an arbitrary condition echo "\t"; ++$array[$key]; // increment the current value } else { // current value is satisfactory echo "\t(advance pointer)\n"; next($array); // move pointer } }
Output for git.master, git.master_jit, rfc.property-hooks
one => 1 one => 2 one => 3 (advance pointer) two => 2 two => 3 (advance pointer) three => 3 (advance pointer) four => 4 (advance pointer)

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:
176.99 ms | 405 KiB | 5 Q