src/PowerTools/HTML5/Parser/Tokenizer.php
protected function readUntilSequence($sequence) {
        $buffer = '';

        // Optimization for reading larger blocks faster.
        $first = substr($sequence, 0, 1);
        while ($this->scanner->current() !== false) {
            $buffer .= $this->scanner->charsUntil($first);

            // Stop as soon as we hit the stopping condition.
            if ($this->sequenceMatches($sequence) || $this->sequenceMatches(strtoupper($sequence))) {
                return $buffer;
            }
            $buffer .= $this->scanner->current();
            $this->scanner->next();
        }

        // If we get here, we hit the EOF.
        $this->parseError("Unexpected EOF during text read.");
        return $buffer;
    }
protected function readUntilSequence($sequence) {
        $buffer = '';

        // Optimization for reading larger blocks faster.
        $first = substr($sequence, 0, 1);
        while ($this->scanner->current() !== false) {
            $buffer .= $this->scanner->charsUntil($first);

            // Stop as soon as we hit the stopping condition.
            if ($this->sequenceMatches($sequence) || $this->sequenceMatches(strtoupper($sequence))) {
                return $buffer;
            }
            $buffer .= $this->scanner->current();
            $this->scanner->next();
        }

        // If we get here, we hit the EOF.
        $this->parseError("Unexpected EOF during text read.");
        return $buffer;
    }
protected function readUntilSequence ( $ sequence ) { $ buffer = '' ; // Optimization for reading larger blocks faster. $ first = substr ( $ sequence , 0 , 1 ) ; while ( $ this -> scanner -> current ( ) !== false ) { $ buffer .= $ this -> scanner -> charsUntil ( $ first ) ; // Stop as soon as we hit the stopping condition. if ( $ this -> sequenceMatches ( $ sequence ) || $ this -> sequenceMatches ( strtoupper ( $ sequence ) ) ) { return $ buffer ; } $ buffer .= $ this -> scanner -> current ( ) ; $ this -> scanner -> next ( ) ; } // If we get here, we hit the EOF. $ this -> parseError ( "Unexpected EOF during text read." ) ; return $ buffer ; }
Read from the input stream until we get to the desired sequene
or hit the end of the input stream.
Read from the input stream until we get to the desired sequene or hit the end of the input stream .