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){ echo $foo.' '.$bartz.' ' .$barvalue.'<br>'; } }
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/UKEYv on line 22 topa seconda Array<br> Notice: Array to string conversion in /in/UKEYv on line 22 topa secondb Array<br> Warning: Invalid argument supplied for foreach() in /in/UKEYv on line 21
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.3.29
topa seconda Array<br>topa secondb Array<br> Warning: Invalid argument supplied for foreach() in /in/UKEYv on line 21
Output for 4.3.11
topa seconda Array<br>topa secondb Array<br>