Ifsnop\Mysqldump\Mysqldump::array_replace_recursive PHP Method

array_replace_recursive() public static method

Custom array_replace_recursive to be used if PHP < 5.3 Replaces elements from passed arrays into the first array recursively
public static array_replace_recursive ( array $array1, array $array2 ) : array
$array1 array The array in which elements are replaced
$array2 array The array from which elements will be extracted
return array Returns an array, or NULL if an error occurs.
    public static function array_replace_recursive($array1, $array2)
    {
        if (function_exists('array_replace_recursive')) {
            return array_replace_recursive($array1, $array2);
        }
        foreach ($array2 as $key => $value) {
            if (is_array($value)) {
                $array1[$key] = self::array_replace_recursive($array1[$key], $value);
            } else {
                $array1[$key] = $value;
            }
        }
        return $array1;
    }