For associative arrays, which is your example both work in the same way.
If you analyze this example by comparing array_replace vs array_marge vs union operator, you will see that each array type has its differential:
Numerical arrays:
$a = array(1, 2, 3);
$b = array(2, 3, 4);
var_dump(array_merge($a, $b));
var_dump(array_replace($a, $b));
var_dump(($a + $b));
What we know of them:
Merge does not replace numbers.
Replace.
Addition operator does not add the elements existing in the last array that are not in the first.
Associative Arrays:
$a = array("batman" => "loser", "superman" => "win", "SuicideSquad" => "Awesome");
$b = array("batman" => "win", "superman" => "loser", "movie" => "Good");
var_dump(array_merge($a, $b));
var_dump(array_replace($a, $b));
var_dump(($a + $b));
What we know of them:
In both replace and merge the values that match the keys are replaced and whatever you have is kept different between them.
In addition it ignores the equal keys and adds only what has different, there is no substitution.
In the third comparison the characteristics of the first case and the second.
Image of https://softonsofa.com.