Replaced extend() with array_replace_recursive() but ensure compatibility backwards