original_string: public function merge_config($config, $localconfig) {
  
          if (!is_array($config) && !is_array($localconfig)) {
              return $localconfig;
          }
  
          // Local overrides also deeper default values.
          if (is_array($config) && !is_array($localconfig)) {
              return $localconfig;
          }
  
          foreach ($localconfig as $key => $value) {
  
              // If defaults are not as deep as local values let locals override.
              if (!is_array($config)) {
                  unset($config);
              }
  
              // Add the param if it doesn't exists or merge branches.
              if (empty($config[$key])) {
                  $config[$key] = $value;
              } else {
                  $config[$key] = $this->merge_config($config[$key], $localconfig[$key]);
              }
          }
  
          return $config;
      }
code: public function merge_config($config, $localconfig) {
  
          if (!is_array($config) && !is_array($localconfig)) {
              return $localconfig;
          }
  
          // Local overrides also deeper default values.
          if (is_array($config) && !is_array($localconfig)) {
              return $localconfig;
          }
  
          foreach ($localconfig as $key => $value) {
  
              // If defaults are not as deep as local values let locals override.
              if (!is_array($config)) {
                  unset($config);
              }
  
              // Add the param if it doesn't exists or merge branches.
              if (empty($config[$key])) {
                  $config[$key] = $value;
              } else {
                  $config[$key] = $this->merge_config($config[$key], $localconfig[$key]);
              }
          }
  
          return $config;
      }
code_tokens: public function merge_config ( $ config , $ localconfig ) { if ( ! is_array ( $ config ) && ! is_array ( $ localconfig ) ) { return $ localconfig ; } // Local overrides also deeper default values. if ( is_array ( $ config ) && ! is_array ( $ localconfig ) ) { return $ localconfig ; } foreach ( $ localconfig as $ key => $ value ) { // If defaults are not as deep as local values let locals override. if ( ! is_array ( $ config ) ) { unset ( $ config ) ; } // Add the param if it doesn't exists or merge branches. if ( empty ( $ config [ $ key ] ) ) { $ config [ $ key ] = $ value ; } else { $ config [ $ key ] = $ this -> merge_config ( $ config [ $ key ] , $ localconfig [ $ key ] ) ; } } return $ config ; }
docstring: Overrides default config with local config values
  
  array_merge does not merge completely the array's values
  
  @param mixed $config The node of the default config
  @param mixed $localconfig The node of the local config
  @return mixed The merge result
docstring_tokens: Overrides default config with local config values