php_parser.php
public function parse($raw)
    {
        if (! isset($this->parser)) {
            return false;
        }
        $length = strlen($raw);
        while (is_array($parsed = $this->reduce($raw))) {
            list($raw, $unmatched, $matched, $mode) = $parsed;
            if (! $this->dispatchTokens($unmatched, $matched, $mode)) {
                return false;
            }
            if ($raw === '') {
                return true;
            }
            if (strlen($raw) == $length) {
                return false;
            }
            $length = strlen($raw);
        }
        if (! $parsed) {
            return false;
        }

        return $this->invokeParser($raw, LEXER_UNMATCHED);
    }
public function parse($raw)
    {
        if (! isset($this->parser)) {
            return false;
        }
        $length = strlen($raw);
        while (is_array($parsed = $this->reduce($raw))) {
            list($raw, $unmatched, $matched, $mode) = $parsed;
            if (! $this->dispatchTokens($unmatched, $matched, $mode)) {
                return false;
            }
            if ($raw === '') {
                return true;
            }
            if (strlen($raw) == $length) {
                return false;
            }
            $length = strlen($raw);
        }
        if (! $parsed) {
            return false;
        }

        return $this->invokeParser($raw, LEXER_UNMATCHED);
    }
Splits the page text into tokens.
Will fail if the handlers report an error or if no content is consumed.
If successful then each unparsed and parsed token invokes a call to the held listener.

@param string $raw        Raw HTML text.

@return bool           True on success, else false.