"It seemed like such a good idea at the time"
This is (in theory) an implementation of the tokenizer described in the WHATWG html spec, written in PHP.
While full, much faster, parsers exist in PHP modules, I wanted access to low level internals for another project. None of the existing options allowed that.
This is tested against the html5lib test suite, but is a completely independent implementation.
It does not include a full parser, because I didn't need that bit, it's just a tokenizer: it wont build the Document object.