3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'a', 'url' => 'b', ], [ 'name' => 'c', 'url' => 'd', 'children' => [ [ 'name' => 'e', 'url' => 'f' ] ] ] ]; function recurseAll(&$node, $key) { if (is_iterable($node)) { foreach ($node as $key => &$childNode) { recurseAll($childNode, $key); } } elseif ($key === "name") { $node = "***{$node}***"; } } array_walk($array, 'recurseAll'); echo "After modified by reference:\n"; var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
After modified by reference: array ( 0 => array ( 'name' => '***a***', 'url' => 'b', ), 1 => array ( 'name' => '***c***', 'url' => 'd', 'children' => array ( 0 => array ( 'name' => '***e***', 'url' => 'f', ), ), ), )

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:
34.63 ms | 406 KiB | 5 Q