public function getNext()
    {
        if ($this->peeking) {
            $this->peeking = false;
            $this->used[] = $this->peeked;

            return $this->peeked;
        }

        if (!isset($this->tokens[$this->cursor])) {
            throw new InternalErrorException('Unexpected token stream end.');
        }

        return $this->tokens[$this->cursor++];
    }
public function getNext()
    {
        if ($this->peeking) {
            $this->peeking = false;
            $this->used[] = $this->peeked;

            return $this->peeked;
        }

        if (!isset($this->tokens[$this->cursor])) {
            throw new InternalErrorException('Unexpected token stream end.');
        }

        return $this->tokens[$this->cursor++];
    }
public function getNext ( ) { if ( $ this -> peeking ) { $ this -> peeking = false ; $ this -> used [ ] = $ this -> peeked ; return $ this -> peeked ; } if ( ! isset ( $ this -> tokens [ $ this -> cursor ] ) ) { throw new InternalErrorException ( 'Unexpected token stream end.' ) ; } return $ this -> tokens [ $ this -> cursor ++ ] ; }
Returns next token.

@return Token

@throws InternalErrorException If there is no more token
Returns next token .