Lexer.php
protected function consume($length = null)
    {

        if ($length === null) {

            if ($this->lastPeekResult === null)
                $this->throwException(
                    "Failed to consume: Nothing has been peeked and you"
                    ." didnt pass a length to consume"
                );

            $length = $this->strlen($this->lastPeekResult);
        }

        $this->input = $this->substr($this->input, $length);
        $this->position += $length;
        $this->offset += $length;

        return $this;
    }
protected function consume($length = null)
    {

        if ($length === null) {

            if ($this->lastPeekResult === null)
                $this->throwException(
                    "Failed to consume: Nothing has been peeked and you"
                    ." didnt pass a length to consume"
                );

            $length = $this->strlen($this->lastPeekResult);
        }

        $this->input = $this->substr($this->input, $length);
        $this->position += $length;
        $this->offset += $length;

        return $this;
    }
protected function consume ( $ length = null ) { if ( $ length === null ) { if ( $ this -> lastPeekResult === null ) $ this -> throwException ( "Failed to consume: Nothing has been peeked and you" . " didnt pass a length to consume" ) ; $ length = $ this -> strlen ( $ this -> lastPeekResult ) ; } $ this -> input = $ this -> substr ( $ this -> input , $ length ) ; $ this -> position += $ length ; $ this -> offset += $ length ; return $ this ; }
Consumes a length or the length of the last peeked string.

Internally $input = substr($input, $length) is done,
so everything _before_ the consumed length will be cut off and
removed from the RAM (since we probably tokenized it already,
remember? sequential shit etc.?)

@see Lexer->peek

@param int|null $length the length to consume or null, to use the length of the last peeked string

@return $this
@throws Exception
Consumes a length or the length of the last peeked string .