3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'topa' => array( 'seconda' => array( 'thirda' => 'thirda value', 'thirdb' => 'thirdb value' ), 'secondb' => array( 'thirdaa' => 'thirdaa value', 'thirdbb' => 'thirdbb value' ) ), 'topb' => 'topbbb' ); foreach($arr as $foo => $bar){ foreach($bar as $bartz => $barvalue){ foreach($barvalue as $tt => $toto) echo $foo.' '.$bartz.' ' .$tt . ' ' .$toto.'<br>'; } }
based on caRns
Output for 4.3.0 - 4.3.10, 4.4.0 - 7.2.0
topa seconda thirda thirda value<br>topa seconda thirdb thirdb value<br>topa secondb thirdaa thirdaa value<br>topa secondb thirdbb thirdbb value<br> Warning: Invalid argument supplied for foreach() in /in/vtcvc on line 21
Output for 4.3.11
topa seconda thirda thirda value<br>topa seconda thirdb thirdb value<br>topa secondb thirdaa thirdaa value<br>topa secondb thirdbb thirdbb value<br>