Merges this navigation item with the other parameter and returns a new NavigationItem.
Works only if there are no duplicate values on one level.

@param NavigationItem $other The navigation item this one should be merged with

@return NavigationItem
167394
public function merge(self $other = null)
    {
        // Create new item
        $new = $this->copyChildless();

        // Add all children from this item
        foreach ($this->getChildren() as $child) {
            /* @var NavigationItem $child */
            $new->addChild($child->merge((null != $other) ? $other->findChildren($child) : null));
        }

        // Add all children from the other item
        if (null != $other) {
            foreach ($other->getChildren() as $child) {
                /** @var NavigationItem $child */
                if (!$new->find($child)) {
                    $new->addChild($child->merge($this->copyChildless()));
                }
            }
        }

        return $new;
    }
548169
public function mergeContext(array $moreContext)
    {
        $this->context = array_replace_recursive(isset($this->context) ? $this->context : [], $moreContext);

        return $this;
    }
621017
public function merge(Intent $another)
    {
        $this->actions = array_merge($this->actions, $another->getActions());
    }
489813
public function merge()
    {
        $args = func_get_args();

        foreach ($args as $arg) {
            if (!($arg instanceof \SplPriorityQueue)) {
                throw new \InvalidArgumentException('Only \SplPriorityQueue can merge.');
            }

            $queue = clone $arg;

            $queue->setExtractFlags(self::EXTR_BOTH);

            foreach ($queue as $item) {
                $this->insert($item['data'], $item['priority']);
            }
        }

        return $this;
    }
1009111
public function merge(array $data)
    {
        $this->items = $this->blueprints()->mergeData($this->items, $data);

        return $this;
    }
487665
public function addItem($item)
    {
        if (!$this->getItems()) {
            return $this->setItems(array($item));
        } else {
            return $this->setItems(
                array_merge($this->getItems(), array($item))
            );
        }
    }
585217
public function merge(Config $other)
    {
        $this->tables = array_merge($this->tables, $other->getTables());
    }
877567
public function vUnion(Collection $other, $sortOrder = SORT_REGULAR)
    {
        return new static(
            \array_unique(
                \array_merge($this->getArrayCopy(), $other->getArrayCopy()),
                $sortOrder
            )
            , $this->type
        );
    }
47656
public function merge(PatchCollection $otherCollection)
    {
        $this->patches = array_merge($this->patches, $otherCollection->getPatches());

        return $this;
    }
994437
public function applyWhenEmpty(callable $other): self
    {
        if (!$this->isEmpty($this->value)) {
            return $this;
        }

        return self::of($other());
    }
287303
public function strictEqual($other)
    {
        $this->doCheck(function ($value) use ($other) {
            $this->throwExceptionIfFalse(
                $value === $other,
                'Value "%s" is not the same as "%s"', $value, $other
            );
        });

        return $this;
    }
1051825
public function merge(Result $otherResult)
    {
        if ($otherResult->errorsExist) {
            $this->mergeProperty($otherResult, 'getErrors', 'addError');
        }
        if ($otherResult->warningsExist) {
            $this->mergeProperty($otherResult, 'getWarnings', 'addWarning');
        }
        if ($otherResult->noticesExist) {
            $this->mergeProperty($otherResult, 'getNotices', 'addNotice');
        }

        /** @var $subResult Result */
        foreach ($otherResult->getSubResults() as $subPropertyName => $subResult) {
            if (array_key_exists($subPropertyName, $this->propertyResults) && $this->propertyResults[$subPropertyName]->hasMessages()) {
                $this->forProperty($subPropertyName)->merge($subResult);
            } else {
                $this->propertyResults[$subPropertyName] = $subResult;
                $subResult->setParent($this);
            }
        }
    }
236689
public function merge(File $other): self
    {
        $new = new static($this->filename);
        $new->issues = array_merge($this->issues, $other->issues);
        return $new;
    }
95596
public function mergeFrom(PhoneNumber $other)
    {
        if ($other->hasCountryCode()) {
            $this->setCountryCode($other->getCountryCode());
        }
        if ($other->hasNationalNumber()) {
            $this->setNationalNumber($other->getNationalNumber());
        }
        if ($other->hasExtension()) {
            $this->setExtension($other->getExtension());
        }
        if ($other->hasItalianLeadingZero()) {
            $this->setItalianLeadingZero($other->isItalianLeadingZero());
        }
        if ($other->hasNumberOfLeadingZeros()) {
            $this->setNumberOfLeadingZeros($other->getNumberOfLeadingZeros());
        }
        if ($other->hasRawInput()) {
            $this->setRawInput($other->getRawInput());
        }
        if ($other->hasCountryCodeSource()) {
            $this->setCountryCodeSource($other->getCountryCodeSource());
        }
        if ($other->hasPreferredDomesticCarrierCode()) {
            $this->setPreferredDomesticCarrierCode($other->getPreferredDomesticCarrierCode());
        }
        return $this;
    }
598348
public function zipLeft($other)
    {
        if (count($other) !== count($this)) {
            throw new \InvalidArgumentException(
                'Both left and right must have same size.'
            );
        }

        if (is_array($other)) {
            $aKeys = array_keys($this->data);
            $other = new Dict($other);

            return new Dict(
                array_map(
                    function ($key) use ($other) {
                        $leftValue = $this->getOrElse($key);
                        $rightValue = $other->getOrElse($key);

                        return new Tuple([$rightValue, $leftValue]);
                    },
                    $aKeys
                )
            );
        }

        if ($other instanceof Dict) {
            return $other->zipLeft($this->data);
        }

        throw new \InvalidArgumentException('`$other` must be `Dict` or `array`');
    }
1135124
public function logicalXor(self $other){
		
		$l = \max(array($this->count(), $other->count()));
		$new = new static();
		
		for($i = 0; $i < $l; ++$i){

			if(isset($this[$i], $other[$i])){
				$new[$i] = (bool)($this[$i] ^ $other[$i]);
			}
			else{
				$new[$i] = false;
			}
			
		}
		
		return $new;
		
	}
982009
public function merge(Loadini $merge)
        {
            foreach($merge as $key => $item) {
                if(Arrays::exists($key, $this->_data)) {
                    if($item instanceof Loadini && $this->$key instanceof Loadini) {
                        $this->$key = $this->$key->merge(new Loadini($item->toArray(), !$this->readOnly()));
                    } else {
                        $this->$key = $item;
                    }
                } else {
                    if($item instanceof Loadini) {
                        $this->$key = new Loadini($item->toArray(), !$this->readOnly());
                    } else {
                        $this->$key = $item;
                    }
                }
            }

            return $this;
        }