private function addAllRecursive($source, $target, array $path = [])
    {
        foreach ($source as $key => $value)
        {
            if (!isset($target[$key]))
            {
                $target[$key] = $value;
            }
            else
            {
                $tgt = $target[$key];

                if (is_array($source) || $source instanceof Dictionary)
                {
                    if ($tgt instanceof Dictionary)
                        $this->addAllRecursive($value, $tgt);
                    else
                        $target[$key] = $value;
                }
                else
                    $target[$key] = $value;
            }
        }
    }
private function addAllRecursive($source, $target, array $path = [])
    {
        foreach ($source as $key => $value)
        {
            if (!isset($target[$key]))
            {
                $target[$key] = $value;
            }
            else
            {
                $tgt = $target[$key];

                if (is_array($source) || $source instanceof Dictionary)
                {
                    if ($tgt instanceof Dictionary)
                        $this->addAllRecursive($value, $tgt);
                    else
                        $target[$key] = $value;
                }
                else
                    $target[$key] = $value;
            }
        }
    }
private function addAllRecursive ( $ source , $ target , array $ path = [ ] ) { foreach ( $ source as $ key => $ value ) { if ( ! isset ( $ target [ $ key ] ) ) { $ target [ $ key ] = $ value ; } else { $ tgt = $ target [ $ key ] ; if ( is_array ( $ source ) || $ source instanceof Dictionary ) { if ( $ tgt instanceof Dictionary ) $ this -> addAllRecursive ( $ value , $ tgt ) ; else $ target [ $ key ] = $ value ; } else $ target [ $ key ] = $ value ; } } }
Recursive function to merge all values from a source dictionary or array
into a target dictionary.
Recursive function to merge all values from a source dictionary or array into a target dictionary .