Merge attributes into route.

@param  array<string, mixed> $old
@param  array<string, mixed> $new
@return array<string, mixed>
972891
public function mergeAttributes( $old, $new ) {
		$attributes = [
			'methods' => $this->mergeMethodsAttribute(
				(array) Arr::get( $old, 'methods', [] ),
				(array) Arr::get( $new, 'methods', [] )
			),

			'condition' => $this->mergeConditionAttribute(
				Arr::get( $old, 'condition', null ),
				Arr::get( $new, 'condition', null )
			),

			'middleware' => $this->mergeMiddlewareAttribute(
				(array) Arr::get( $old, 'middleware', [] ),
				(array) Arr::get( $new, 'middleware', [] )
			),

			'namespace' => $this->mergeNamespaceAttribute(
				Arr::get( $old, 'namespace', '' ),
				Arr::get( $new, 'namespace', '' )
			),

			'handler' => $this->mergeHandlerAttribute(
				Arr::get( $old, 'handler', '' ),
				Arr::get( $new, 'handler', '' )
			),

			'query' => $this->mergeQueryAttribute(
				Arr::get( $old, 'query', null ),
				Arr::get( $new, 'query', null )
			),
		];

		return $attributes;
	}
1320698
protected static function formatPrefix($new, $old)
    {
        $old = $old['prefix'] ?? null;

        return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old;
    }
393040
function merge(_old, _new) {
        for (var i in _new) {
            if (_new.hasOwnProperty(i)) {
                _old[i] = _new[i];
            }
        }
        return _old;
    }
1217052
public static function mergeGroup($new, $old)
	{
		$new['namespace'] = static::formatUsesPrefix($new, $old);

		$new['prefix'] = static::formatGroupPrefix($new, $old);

		if (isset($new['domain'])) unset($old['domain']);

		return array_merge_recursive(array_except($old, array('namespace', 'prefix')), $new);
	}
1009627
public function replace(DOMElement &$old, &$new)
    {
        // Check if the element has a parent node
        if (empty($old->parentNode)) {
            throw new DOMException('The current DOMItem has no parent.');
        }

        // Replace the element
        $old->parentNode->replaceChild($new, $old);

        return $new;
    }
748424
public function rename_mbox($old, $new){
    if ( $this->is_connected() ){
      return imap_renamemailbox($this->stream, $this->mbParam. $old, $this->mbParam. $new);
    }
    return false;
  }
514233
public static function makeFromExisting(IlluminateResponse $old)
    {
        $new = static::create($old->getOriginalContent(), $old->getStatusCode());

        $new->headers = $old->headers;

        return $new;
    }
1006521
public function rename($old, $new)
    {
        return ($this->isConnected() === true) ? ftp_rename($this->getConnection(), $old, $new) : false;
    }
854059
protected function auditUpdatedAttributes(array &$old, array &$new)
    {
        foreach ($this->getDirty() as $attribute => $value) {
            if ($this->isAttributeAuditable($attribute)) {
                $old[$attribute] = array_get($this->original, $attribute);
                $new[$attribute] = array_get($this->attributes, $attribute);
            }
        }

        if ($this->shouldDynamicTableExist()) {
            foreach ($this->properties->getDirty() as $attribute => $value) {
                if (! in_array($attribute, $this->auditableExclusions)) {
                    $old[$this->type->identifier][$attribute] = array_get($this->properties->getOriginal(), $attribute);
                    $new[$this->type->identifier][$attribute] = array_get($this->properties->getAttributes(), $attribute);
                }
            }
        }
    }
901777
protected function equals($old, $new)
    {
        if (is_array($old)) {
            // compare arrays
            if (array_keys($old) != array_keys($new)) {
                return false;
            }

            foreach (array_keys($old) as $key) {
                if ( ! $this->equals($old[$key], $new[$key])) {
                    return false;
                }
            }

            return true;
        }

        if ( ! is_object($old) ) {
            // compare non-array scalars
            return ($old == $new);
        }

        if (get_class($old) != get_class($new)) {
            // compare object by class name
            return false;
        }

        // compare each sub-node
        foreach ($old->getSubNodeNames() as $property) {
            if ( ! $this->equals($old->$property, $new->$property)) {
                return false;
            }
        }

        return true;
    }
818351
protected function updateFavicon( $new, $old )
    {
        $this->removeFile( $old );
        $new = $this->addFile( $new, 'settings/favicon.%2$s' );
        $this->setSetting( 'faviconType', $this->getMime( $new ) );
        return $new;
    }
530836
protected function merge(array $old, array $new)
    {
        foreach ($new as $key => $value) {
            if (isset($old[$key]) && is_array($old[$key]) && is_array($value)) {
                $old[$key] = $this->merge($old[$key], $value);
            } else {
                $old[$key] = $value;
            }
        }

        return $old;
    }
22044
protected function formatNamespace(array $new, array $old)
    {
        if (isset($new['namespace']) && isset($old['namespace'])) {
            return trim($old['namespace'], '\\').'\\'.trim($new['namespace'], '\\');
        } elseif (isset($new['namespace'])) {
            return trim($new['namespace'], '\\');
        }

        return array_get($old, 'namespace');
    }
321415
public function handle($old, $new)
    {
        if ( ! $this->canHandle($old) || ! $this->canHandle($new)) {
            return null;
        }

        if ($this->equals($old, $new)) {
            return false;
        }

        $this->lastException = new FailedConstraint(
            sprintf(
                '%s() body changed',
                $new->name
            )
        );

        return true;
    }
832514
protected function mergeOldRoutes($version)
    {
        if (! isset($this->oldRoutes)) {
            $this->oldRoutes = $this->router->getRoutes();
        }

        if (! isset($this->mergedRoutes[$version])) {
            $this->mergedRoutes[$version] = $this->routes[$version];

            foreach ($this->oldRoutes as $route) {
                $this->mergedRoutes[$version]->add($route);
            }
        }

        return $this->mergedRoutes[$version];
    }
739951
function createDifferenceObject( $old, $new )
    {
        $container = new eZDiffContainerObject();
        $container->setOldContent( $old );
        $container->setNewContent( $new );

        return $container;
    }
393202
protected function compaireSecondary($old, $new)
    {
        $oldMajor = dot($old)[0];
        $newMajor = dot($new)[0];

        $oldMinor = dot($old)[1];
        $newMinor = dot($new)[1];

        $oldSecondary = dot($old)[2];
        $newSecondary = dot($new)[2];

        return $oldSecondary != $newSecondary && $oldMajor == $newMajor && $oldMinor == $newMinor;
    }