3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array (1=>1, 2=> 2, 3 => array(1=>11, 2=>12, 3=>13)); $text = "test"; function modarr($array, $text) { foreach ($array as $key => $arr) { if(is_array($arr)) $res[$key] = modarr($arr,$text); // modification function here else $res[$key] = $arr.$text; } return $res; } $erg = modarr($array, $text); print_r($erg);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [1] => 1test [2] => 2test [3] => Array ( [1] => 11test [2] => 12test [3] => 13test ) )

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