src/Digex/YamlConfigLoader.php
protected function deepMerge($leftSide, $rightSide)
    {
        if (!is_array($rightSide)) {
            
            return $rightSide;
        }
        
        foreach ($rightSide as $k => $v) {
            // no conflict
            if (!array_key_exists($k, $leftSide)) {

                $leftSide[$k] = $v;
                continue;
            }
            
            $leftSide[$k] = $this->deepMerge($leftSide[$k], $v);
        }
        
        return $leftSide;
    }
protected function deepMerge($leftSide, $rightSide)
    {
        if (!is_array($rightSide)) {
            
            return $rightSide;
        }
        
        foreach ($rightSide as $k => $v) {
            // no conflict
            if (!array_key_exists($k, $leftSide)) {

                $leftSide[$k] = $v;
                continue;
            }
            
            $leftSide[$k] = $this->deepMerge($leftSide[$k], $v);
        }
        
        return $leftSide;
    }
protected function deepMerge ( $ leftSide , $ rightSide ) { if ( ! is_array ( $ rightSide ) ) { return $ rightSide ; } foreach ( $ rightSide as $ k => $ v ) { // no conflict if ( ! array_key_exists ( $ k , $ leftSide ) ) { $ leftSide [ $ k ] = $ v ; continue ; } $ leftSide [ $ k ] = $ this -> deepMerge ( $ leftSide [ $ k ] , $ v ) ; } return $ leftSide ; }
Do a deep merge of two arrays

@param array $leftSide
@param array $rightSide
@return array
Do a deep merge of two arrays