public function slice(int $offset, ?int $length = null): self
    {
        return Factory::create(\array_slice($this->items, $offset, $length, true));
    }
public function slice(int $offset, ?int $length = null): self
    {
        return Factory::create(\array_slice($this->items, $offset, $length, true));
    }
public function slice ( int $ offset , ? int $ length = null ) : self { return Factory :: create ( \ array_slice ( $ this -> items , $ offset , $ length , true ) ) ; }
Get a slice of the collection and inject it in a new Collection.

@performanceCompared true
Get a slice of the collection and inject it in a new Collection .