public function takeAllUntil(string $ends): string
    {
        $ends = self::split($ends);

        $ends[] = self::END;

        $taken = "";

        while (!in_array($this->peek(), $ends)) {
            $char = $this->take();

            $taken .= $char;
        }

        return $taken;
    }
public function takeAllUntil(string $ends): string
    {
        $ends = self::split($ends);

        $ends[] = self::END;

        $taken = "";

        while (!in_array($this->peek(), $ends)) {
            $char = $this->take();

            $taken .= $char;
        }

        return $taken;
    }
public function takeAllUntil ( string $ ends ) : string { $ ends = self :: split ( $ ends ) ; $ ends [ ] = self :: END ; $ taken = "" ; while ( ! in_array ( $ this -> peek ( ) , $ ends ) ) { $ char = $ this -> take ( ) ; $ taken .= $ char ; } return $ taken ; }
Removes all characters from the input until one of the end characters is
encountered. Returns the read removed.

@param string $ends
@return string
Removes all characters from the input until one of the end characters is encountered . Returns the read removed .