3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arrs = array(); $arrs[] = array('something1', something2); $arrs[] = array('something3', something4); $arrs[] = array(); $arrs[] = array('something1', something2); $list = array(); foreach($arrs as $arr) { if(is_array($arr)) { $list = array_merge($list, $arr); } } print_r($list);
Output for 4.3.0 - 7.1.0
Notice: Use of undefined constant something2 - assumed 'something2' in /in/OCdWL on line 4 Notice: Use of undefined constant something4 - assumed 'something4' in /in/OCdWL on line 5 Notice: Use of undefined constant something2 - assumed 'something2' in /in/OCdWL on line 7 Array ( [0] => something1 [1] => something2 [2] => something3 [3] => something4 [4] => something1 [5] => something2 )