If you verify that your semantics behave the same as in the Zend PHP implementation, I would recommend creating an automated tool for generating grammar from BNF from PHP itself. This way you will have many .php files expressing most of the semantics. Remember to include a lot of trace code in the generated files.
Then run it through the Zend implementation and yours to make sure you get the same check. Use incorrect code generation so you catch it too. Only when you know that your implementation is correct (with quirks) can you move on.
http://llvm.org/devmtg/2008-08/Lopes_PHP-JIT-InTwoDays.pdf . , PHP JIT LLVM. , .