src/PowerTools/HTML5/Parser/Tokenizer.php
protected function endTag() {
        if ($this->scanner->current() != '/') {
            return false;
        }
        $tok = $this->scanner->next();

        // a-zA-Z -> tagname
        // > -> parse error
        // EOF -> parse error
        // -> parse error
        if (!ctype_alpha($tok)) {
            $this->parseError("Expected tag name, got '%s'", $tok);
            if ($tok == "\0" || $tok === false) {
                return false;
            }
            return $this->bogusComment('</');
        }

        $name = strtolower($this->scanner->charsUntil("\n\f \t>"));
        // Trash whitespace.
        $this->scanner->whitespace();

        if ($this->scanner->current() != '>') {
            $this->parseError("Expected >, got '%s'", $this->scanner->current());
            // We just trash stuff until we get to the next tag close.
            $this->scanner->charsUntil('>');
        }

        $this->events->endTag($name);
        $this->scanner->next();
        return true;
    }
protected function endTag() {
        if ($this->scanner->current() != '/') {
            return false;
        }
        $tok = $this->scanner->next();

        // a-zA-Z -> tagname
        // > -> parse error
        // EOF -> parse error
        // -> parse error
        if (!ctype_alpha($tok)) {
            $this->parseError("Expected tag name, got '%s'", $tok);
            if ($tok == "\0" || $tok === false) {
                return false;
            }
            return $this->bogusComment('</');
        }

        $name = strtolower($this->scanner->charsUntil("\n\f \t>"));
        // Trash whitespace.
        $this->scanner->whitespace();

        if ($this->scanner->current() != '>') {
            $this->parseError("Expected >, got '%s'", $this->scanner->current());
            // We just trash stuff until we get to the next tag close.
            $this->scanner->charsUntil('>');
        }

        $this->events->endTag($name);
        $this->scanner->next();
        return true;
    }
protected function endTag ( ) { if ( $ this -> scanner -> current ( ) != '/' ) { return false ; } $ tok = $ this -> scanner -> next ( ) ; // a-zA-Z -> tagname // > -> parse error // EOF -> parse error // -> parse error if ( ! ctype_alpha ( $ tok ) ) { $ this -> parseError ( "Expected tag name, got '%s'" , $ tok ) ; if ( $ tok == "\0" || $ tok === false ) { return false ; } return $ this -> bogusComment ( '</' ) ; } $ name = strtolower ( $ this -> scanner -> charsUntil ( "\n\f \t>" ) ) ; // Trash whitespace. $ this -> scanner -> whitespace ( ) ; if ( $ this -> scanner -> current ( ) != '>' ) { $ this -> parseError ( "Expected >, got '%s'" , $ this -> scanner -> current ( ) ) ; // We just trash stuff until we get to the next tag close. $ this -> scanner -> charsUntil ( '>' ) ; } $ this -> events -> endTag ( $ name ) ; $ this -> scanner -> next ( ) ; return true ; }
Consume an end tag.
8.2.4.9
Consume an end tag . 8 . 2 . 4 . 9