public static function extendDistinct()
    {
        $merged = [];

        foreach (func_get_args() as $array) {
            foreach ($array as $key => $value) {
                if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
                    if (static::isAssoc($value) && static::isAssoc($merged[$key])) {
                        $merged[$key] = static::extendDistinct($merged[$key], $value);

                        continue;
                    }
                }

                $merged[$key] = $value;
            }
        }

        return $merged;
    }
public static function extendDistinct()
    {
        $merged = [];

        foreach (func_get_args() as $array) {
            foreach ($array as $key => $value) {
                if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
                    if (static::isAssoc($value) && static::isAssoc($merged[$key])) {
                        $merged[$key] = static::extendDistinct($merged[$key], $value);

                        continue;
                    }
                }

                $merged[$key] = $value;
            }
        }

        return $merged;
    }
public static function extendDistinct ( ) { $ merged = [ ] ; foreach ( func_get_args ( ) as $ array ) { foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) && static :: has ( $ merged , $ key ) && is_array ( $ merged [ $ key ] ) ) { if ( static :: isAssoc ( $ value ) && static :: isAssoc ( $ merged [ $ key ] ) ) { $ merged [ $ key ] = static :: extendDistinct ( $ merged [ $ key ] , $ value ) ; continue ; } } $ merged [ $ key ] = $ value ; } } return $ merged ; }
Extend one array with another. Non associative arrays will not be merged
but rather replaced.

@return array
Extend one array with another . Non associative arrays will not be merged but rather replaced .