src/Primitive/Container/Container.php
public function cut($offset, $length = null, $preserveKeys = false, $set = false)
    {
        $result = array_slice(
            $this->items,
            $this->getIntegerable($offset),
            $this->getIntegerable($length),
            $this->getBoolable($preserveKeys)
        );

        if ($this->getBoolable($set))
        {
            $this->items = empty($result) ? [] : $result;

            return $this;
        }

        return new static($result);
    }
public function cut($offset, $length = null, $preserveKeys = false, $set = false)
    {
        $result = array_slice(
            $this->items,
            $this->getIntegerable($offset),
            $this->getIntegerable($length),
            $this->getBoolable($preserveKeys)
        );

        if ($this->getBoolable($set))
        {
            $this->items = empty($result) ? [] : $result;

            return $this;
        }

        return new static($result);
    }
Cut a slice of a Container.
You can return result or assign to Container with the forth argument.

@param int|IntegerContract $offset
@param null|int|IntegerContract $length
@param bool|BooleanContract $preserveKeys
@param bool|BooleanContract $set
@return static|$this