Issue #1854870 by DamienMcKenna: Replaced the array_replace_recursive() function with one taken from php.net.