3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function arrayStack( $array, $dash ){ foreach($array as $value){ if(isset($value['id'])){ echo str_repeat("-", $dash).$value['id'].'<br/>'; }else{ $dash++; arrayStack( $value, $dash ); $dash--; } } } arrayStack( $myArray, 0 );
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: myArray in /in/5v57j on line 16 Warning: Invalid argument supplied for foreach() in /in/5v57j on line 5
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.3
Notice: Undefined variable: myArray in /in/5v57j on line 16 Warning: Invalid argument supplied for foreach() in /in/5v57j on line 5
Output for 4.3.11
Notice: Undefined variable: myArray in /in/5v57j on line 16