There are also some PECL extensions that parse PHP code for various reasons. First up is BCompiler , which can compile PHP into byte code. Since this step requires parsing the PHP code, I would expect errors if it is not lint. Parsekit allwos you have to compile PHP code for OP codes, which is basically what you want. However, the extension has not been released since the end of 2009, so it may be deprecated. Parse_Tree has been sadly not supported since 2007, but its goal is to parse the PHP file in AST. Maybe you can get something with this, after some polishing.
PHP_Parser is a PEAR package that does not rely on special PHP extensions and tries to parse PHP code from PHP. Its marked alpha and unsupported, but it may give you reason to experiment.
source share