I am trying to overwrite the elements of one array with values from another – without creating additional elements in the process.
For example:
Try this:
$result = array_replace($base, array_intersect_key($replace, $base));