src/DS/Traits/TraitSequence.php
public function insert(int $index, ...$values): Sequence
    {

        $this->resolver->values(function (\DS\Map $map) use ($index): void {

            $values = $map->values();
            $this->items->insert($index, ...$values);
        }, $values);

        return $this;
    }
public function insert(int $index, ...$values): Sequence
    {

        $this->resolver->values(function (\DS\Map $map) use ($index): void {

            $values = $map->values();
            $this->items->insert($index, ...$values);
        }, $values);

        return $this;
    }
public function insert ( int $ index , ... $ values ) : Sequence { $ this -> resolver -> values ( function ( \ DS \ Map $ map ) use ( $ index ) : void { $ values = $ map -> values ( ) ; $ this -> items -> insert ( $ index , ... $ values ) ; } , $ values ) ; return $ this ; }
Inserts zero or more values at a given index.

Each value after the index will be moved one position to the right.
Values may be inserted at an index equal to the size of the sequence.

@param int   $index
@param mixed ...$values

@return \PlanB\DS\Sequence

@throws \OutOfRangeException if the index is not in the range [0, n]
Inserts zero or more values at a given index .