3v4l.org

run code in 300+ PHP versions simultaneously
<?php $walk_arr = [ 0 => "A", 1 => "B", 3 => "D", 5 => "F", ]; global $stop_walk; $stop_walk = false; $walk_func = function(&$v, $k) { global $stop_walk; if ($k === 3) { $stop_walk = true; } if ($stop_walk) { return; } $v .= " changed"; }; unset($stop_walk); array_walk($walk_arr, $walk_func); print_r($walk_arr); print $stop_walk;
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => A changed [1] => B changed [3] => D [5] => F ) 1

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