3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'one' => 'hi there', 'two' => 'hello there', 'three' => array( 'one' => 'hey d00d', 'two' => 'greetings', ), ); $gather = array(); function step_and_gather($item, $key, &$gather) { $gather[] = $item; echo "==> Gathering at {$key}\n"; print_r($gather); } array_walk_recursive($arr, 'step_and_gather', $gather); echo "==> Final answer <==\n"; print_r($gather);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: step_and_gather(): Argument #3 ($gather) must be passed by reference, value given in /in/asHBJ on line 19 ==> Gathering at one Array ( [0] => hi there ) Warning: step_and_gather(): Argument #3 ($gather) must be passed by reference, value given in /in/asHBJ on line 19 ==> Gathering at two Array ( [0] => hello there ) Warning: step_and_gather(): Argument #3 ($gather) must be passed by reference, value given in /in/asHBJ on line 19 ==> Gathering at one Array ( [0] => hey d00d ) Warning: step_and_gather(): Argument #3 ($gather) must be passed by reference, value given in /in/asHBJ on line 19 ==> Gathering at two Array ( [0] => greetings ) ==> Final answer <== Array ( )

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