public function take(): string
    {
        if ($this->atEnd()) {
            $this->lastTaken = self::END;

            return self::END;
        }

        $char = $this->input[$this->index];

        $this->index += 1;

        $this->lastTaken = $char;

        return $char;
    }
public function take(): string
    {
        if ($this->atEnd()) {
            $this->lastTaken = self::END;

            return self::END;
        }

        $char = $this->input[$this->index];

        $this->index += 1;

        $this->lastTaken = $char;

        return $char;
    }
public function take ( ) : string { if ( $ this -> atEnd ( ) ) { $ this -> lastTaken = self :: END ; return self :: END ; } $ char = $ this -> input [ $ this -> index ] ; $ this -> index += 1 ; $ this -> lastTaken = $ char ; return $ char ; }
Returns the next character and removes it from the input.

@return string
Returns the next character and removes it from the input .