src/Collection.php
public function insert($index, $item)
    {
        $this->validateIndex($index);
        $this->validateItem($item, $this->type);

        $partA = array_slice($this->items, 0, $index);
        $partB = array_slice($this->items, $index, count($this->items));
        $partA[] = $item;

        $items = array_merge($partA, $partB);
        $col = new static ($this->type);
        $col->setItemsFromTrustedSource($items);

        return $col;
    }
public function insert($index, $item)
    {
        $this->validateIndex($index);
        $this->validateItem($item, $this->type);

        $partA = array_slice($this->items, 0, $index);
        $partB = array_slice($this->items, $index, count($this->items));
        $partA[] = $item;

        $items = array_merge($partA, $partB);
        $col = new static ($this->type);
        $col->setItemsFromTrustedSource($items);

        return $col;
    }
{@inheritdoc}