3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arrs = array(); $arrs[] = array('something1', 2); $arrs[] = array('something3', 'something4'); $arrs[] = array(); $arrs[] = array('something1', 3.12); $list = array(); foreach($arrs as $key=>$arr) { if(is_array($arr)) { $list = array_merge($list, $arr); } else{ echo $key." not array"; } } print_r($list);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => something1 [1] => 2 [2] => something3 [3] => something4 [4] => something1 [5] => 3.12 )
Output for hhvm-3.10.0

Process exited with code 153.