src/Structures/Buffer.php
public function remove(int $length, int $offset = 0): string
    {
        $length = (int) $length;
        if (0 >= $length) {
            return '';
        }
        
        $offset = (int) $offset;
        if (0 > $offset) {
            $offset = 0;
        }
        
        $buffer = (string) substr($this->data, $offset, $length);
        
        if (0 === $offset) {
            $this->data = (string) substr($this->data, $length);
        } else {
            $this->data = (string) (substr($this->data, 0, $offset) . substr($this->data, $offset + $length));
        }
        
        return $buffer;
    }
public function remove(int $length, int $offset = 0): string
    {
        $length = (int) $length;
        if (0 >= $length) {
            return '';
        }
        
        $offset = (int) $offset;
        if (0 > $offset) {
            $offset = 0;
        }
        
        $buffer = (string) substr($this->data, $offset, $length);
        
        if (0 === $offset) {
            $this->data = (string) substr($this->data, $length);
        } else {
            $this->data = (string) (substr($this->data, 0, $offset) . substr($this->data, $offset + $length));
        }
        
        return $buffer;
    }
Removes and returns the given number of characters (at most) from the buffer.

@param int $length
@param int $offset

@return string