src/TokenStream.php
public function peek($distance=1)
    {
        if (isset($this->stream[$this->position + $distance])) {
            return $this->stream[$this->position + $distance];
        }

        // if we try to peak beyond the end of the stream return the last token
        return $this->stream[count($this->stream) - 1];
    }
public function peek($distance=1)
    {
        if (isset($this->stream[$this->position + $distance])) {
            return $this->stream[$this->position + $distance];
        }

        // if we try to peak beyond the end of the stream return the last token
        return $this->stream[count($this->stream) - 1];
    }
{@inheritdoc}