The function signature on PHP.net for array_replace() says that the arrays will be passed in by reference. What would be the reason(s)/benefit(s) to doing it this way rather than by value since to get the intended result you must return the finished array to a variable. Just to be clear, I am able to reproduce the results in the manual, so this is not a question on how to use this function.
Here is the function signature and an example, both from php.net.
Source: http://ca3.php.net/manual/en/function.array-replace.php
Function signature:
array array_replace ( array &$array , array &$array1 [, array &$... ] )
Example code:
$base = array("orange", "banana", "apple", "raspberry");
$replacements = array(0 => "pineapple", 4 => "cherry");
$replacements2 = array(0 => "grape");
$basket = array_replace($base, $replacements, $replacements2);
print_r($basket);
The above example will output:
Array
(
[0] => grape
[1] => banana
[2] => apple
[3] => raspberry
[4] => cherry
)