src/Collection/ArrayCollection.php
public function slice(int $offset, ?int $length = null): ArrayCollection
    {
        return new static(array_slice($this->items, $offset, $length, true));
    }
public function slice(int $offset, ?int $length = null): ArrayCollection
    {
        return new static(array_slice($this->items, $offset, $length, true));
    }
public function slice ( int $ offset , ? int $ length = null ) : ArrayCollection { return new static ( array_slice ( $ this -> items , $ offset , $ length , true ) ) ; }
Creates a collection from a slice of items

@param int      $offset The starting offset
@param int|null $length The length or null for remaining

@return ArrayCollection
Creates a collection from a slice of items