3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a[] = array('a'=>1); $a[] = array('a'=>2); $a[] = array('a'=>3); $b = array(); $b[] = array('a'=>1, 'b'=>2); $b[] = array('a'=>2, 'b'=>2); $b[] = array('a'=>3, 'b'=>2); $c = array_merge($a, $b); var_dump($c);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(6) { [0]=> array(1) { ["a"]=> int(1) } [1]=> array(1) { ["a"]=> int(2) } [2]=> array(1) { ["a"]=> int(3) } [3]=> array(2) { ["a"]=> int(1) ["b"]=> int(2) } [4]=> array(2) { ["a"]=> int(2) ["b"]=> int(2) } [5]=> array(2) { ["a"]=> int(3) ["b"]=> int(2) } }