public function mergeCanadian(array $a, array $b) {
    $a += $b;
    foreach ($a as $k => $v) {
      if (is_array($v) && isset($b[$k]) && is_array($b[$k])) {
        $a[$k] = static::mergeCanadian($a[$k], $b[$k]);
      }
    }
    return $a;
  }
public function mergeCanadian(array $a, array $b) {
    $a += $b;
    foreach ($a as $k => $v) {
      if (is_array($v) && isset($b[$k]) && is_array($b[$k])) {
        $a[$k] = static::mergeCanadian($a[$k], $b[$k]);
      }
    }
    return $a;
  }
public function mergeCanadian ( array $ a , array $ b ) { $ a += $ b ; foreach ( $ a as $ k => $ v ) { if ( is_array ( $ v ) && isset ( $ b [ $ k ] ) && is_array ( $ b [ $ k ] ) ) { $ a [ $ k ] = static :: mergeCanadian ( $ a [ $ k ] , $ b [ $ k ] ) ; } } return $ a ; }
Recursively merges arrays using the + method.

Existing keys at all levels of $a, both numeric and associative, will
always be preserved. That's why I'm calling this a "Canadian" merge -- it
does not want to step on any toes.

@param array $a
The input array.
@param array $b
The array to merge into $a.

@return array
The merged array.
Recursively merges arrays using the + method .