3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $first = ['a' => 1, 'b' => 2]; $second = ['a' => 3, 'd' => 4]; var_dump($first + $second); var_dump(array_merge($second, $first)); var_dump(array_merge($second, $first) === $first + $second);
based on IaZfA
Output for 5.6.38 - 7.3.0rc3
array(3) { ["a"]=> int(1) ["b"]=> int(2) ["d"]=> int(4) } array(3) { ["a"]=> int(1) ["d"]=> int(4) ["b"]=> int(2) } bool(false)