3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $X = array('a' => 'a in X', 'ab' => 'ab in X', 'na' => null, 'nb' => 'nb in X'); $Y = array('b' => 'b in Y', 'ab' => 'ab in Y', 'na' => 'na in Y', 'nb' => null); $XY = array_merge($X, $Y); var_dump($XY);
based on HPF1E
Output for 4.3.0 - 7.2.0
array(5) { ["a"]=> string(6) "a in X" ["ab"]=> string(7) "ab in Y" ["na"]=> string(7) "na in Y" ["nb"]=> NULL ["b"]=> string(6) "b in Y" }