3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr1 = array('123' => '123', '456' => '456'); $arr2 = array('123' => '123'); print_r(array_merge_recursive($arr1, $arr2)); $arr1 = array('x123' => 'x123', 'x456' => 'x456'); $arr2 = array('x123' => 'x123'); print_r(array_merge_recursive($arr1, $arr2));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 123 [1] => 456 [2] => 123 ) Array ( [x123] => Array ( [0] => x123 [1] => x123 ) [x456] => x456 )