3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printAll(&$a) { if (!is_array($a)) { //echo $a . "<br/>"; return; } foreach($a as $b =>$c) { if(is_array($c)) { if($a =="nutts"){$a["test"] = array();} // trying to loop though multidimensional array and add array echo "here is a step $b<br/>"; printAll($c); } // end if array } // end foreach //printAll($a); }// end printAll $array = array('hello', "natts"=>array('world', '!', array('whats'), 'up'), array('?')); printAll($aarray); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(5) "hello" ["natts"]=> array(4) { [0]=> string(5) "world" [1]=> string(1) "!" [2]=> array(1) { [0]=> string(5) "whats" } [3]=> string(2) "up" } [1]=> array(1) { [0]=> string(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:
36.5 ms | 401 KiB | 8 Q