The documentation is wrongly phrased: "array_replace() replaces the values of array1" No replacing is done. A new array is created which looks like the one that would have resulted from the described replacement.
If you want to augment the set of indices in an array, use
array_to_be_modified += array_with_indices_to_add;