3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array1 = ['foo' => [1, 2], 'bar' => 1]; $array2 = ['foo' => [3, 4], 'bar' => 2]; var_dump(array_replace_recursive($array1, $array2));
based on S9Wkg
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0alpha1
array(2) { ["foo"]=> array(2) { [0]=> int(3) [1]=> int(4) } ["bar"]=> int(2) }