src/Configuration.php
private function arrayMergeRecursive(array ...$arrays)
    {
        $base = array_shift($arrays);
        if ( ! is_array($base)) {
            $base = empty($base) ? [] : [$base];
        }

        foreach ($arrays as $append) {
            if ( ! is_array($append)) {
                $append = [$append];
            }
            foreach ($append as $key => $value) {
                if ( ! array_key_exists($key, $base) && ! is_numeric($key)) {
                    $base[$key] = $append[$key];
                    continue;
                }

                if ((is_array($value) || (isset($base[$key]) && is_array($base[$key]))) && $this->isAssoc($value)) {
                    $base[$key] = $this->arrayMergeRecursive(
                        (array) $base[$key],
                        (array) $append[$key]
                    );
                } else {
                    if (is_numeric($key)) {
                        if ( ! in_array($value, $base)) {
                            $base[] = $value;
                        }
                    } else {
                        $base[$key] = $value;
                    }
                }
            }
        }

        return $base;
    }
private function arrayMergeRecursive(array ...$arrays)
    {
        $base = array_shift($arrays);
        if ( ! is_array($base)) {
            $base = empty($base) ? [] : [$base];
        }

        foreach ($arrays as $append) {
            if ( ! is_array($append)) {
                $append = [$append];
            }
            foreach ($append as $key => $value) {
                if ( ! array_key_exists($key, $base) && ! is_numeric($key)) {
                    $base[$key] = $append[$key];
                    continue;
                }

                if ((is_array($value) || (isset($base[$key]) && is_array($base[$key]))) && $this->isAssoc($value)) {
                    $base[$key] = $this->arrayMergeRecursive(
                        (array) $base[$key],
                        (array) $append[$key]
                    );
                } else {
                    if (is_numeric($key)) {
                        if ( ! in_array($value, $base)) {
                            $base[] = $value;
                        }
                    } else {
                        $base[$key] = $value;
                    }
                }
            }
        }

        return $base;
    }
private function arrayMergeRecursive ( array ... $ arrays ) { $ base = array_shift ( $ arrays ) ; if ( ! is_array ( $ base ) ) { $ base = empty ( $ base ) ? [ ] : [ $ base ] ; } foreach ( $ arrays as $ append ) { if ( ! is_array ( $ append ) ) { $ append = [ $ append ] ; } foreach ( $ append as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ base ) && ! is_numeric ( $ key ) ) { $ base [ $ key ] = $ append [ $ key ] ; continue ; } if ( ( is_array ( $ value ) || ( isset ( $ base [ $ key ] ) && is_array ( $ base [ $ key ] ) ) ) && $ this -> isAssoc ( $ value ) ) { $ base [ $ key ] = $ this -> arrayMergeRecursive ( ( array ) $ base [ $ key ] , ( array ) $ append [ $ key ] ) ; } else { if ( is_numeric ( $ key ) ) { if ( ! in_array ( $ value , $ base ) ) { $ base [ ] = $ value ; } } else { $ base [ $ key ] = $ value ; } } } } return $ base ; }
Works like array_merge_recursive_distinct,
but not merge sequential list.

@param array ...$arrays
@return array|mixed
Works like array_merge_recursive_distinct but not merge sequential list .