3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test_1 = array( array('product' => 'test1', 'sku' => 't1'), array('product' => 'test2', 'sku' => 't2'), ); // $test_2 = array(); // $test_2 = array('teet', 'sefsefse'); $test_2 = array(array('product' => 'test3', 'sku' => 't3')); var_dump(array_merge($test_1, $test_2));
based on k5qgb
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> array(2) { ["product"]=> string(5) "test1" ["sku"]=> string(2) "t1" } [1]=> array(2) { ["product"]=> string(5) "test2" ["sku"]=> string(2) "t2" } [2]=> array(2) { ["product"]=> string(5) "test3" ["sku"]=> string(2) "t3" } }