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);

preferences:
63.3 ms | 402 KiB | 5 Q