Stefan Esser's Bytekit is an extension to the PHP interpreter that provides a userspace representation of the bytecode that is generated during the PHP interpreter's compilation phase. The extension not only exports the raw bytecode data but also provides control flow information in the form of code flow graphs and basic blocks. Among other things, Bytekit is developed with the goal of providing a foundation to develop all kinds of static and dynamic code analysis tools.

bytekit-cli is such an analysis tool that I started to develop immediately after Stefan released Bytekit 0.1.0 at the International PHP Conference - Spring Edition in Berlin earlier this year. This posting provides an overview of the functionality implemented so far.