看看这个
http://www.derickrethans.nl/vld.php
Vulcan Logic Disassembler
The Vulcan Logic Disassembler hooks into the Zend Engine and dumps all the opcodes (execution units) of a script. It was written as as a beginning of an encoder, but I never got the time for that. It can be used to see what is going on in the Zend Engine.
New Features in 0.6
Class methods info is only dumped if they contain some user defined functions.
Clean up the framework for better opcode display.
Print extended value for function calls (# of args in that case).
Op code elements are only printed when they are actually used.
Download and Installation Instructions
The extension is not totally finished yet, but it works fine for me. If you have questions, feel free to send me an e-mail (but read this first) at derick at php dot net. If you like this piece of software, feel free to checkout my wishlist or Andrei’s. This improves chances that we will be continuing developing VLD.
You can download the source here or get it from CVS. The CVS root is “srmread@cvs.vl-srm.net:/repository”, the module is “vle” (not “vld”) and the password is “srmread”.
It’s not hard to use this extension, but it might not work with all PHP versions. Here are the instructions to get it to work:
Unpack the tarball: tar -xzf vld-0.6.0.tgz.
After you untarred the ball you need to copy the directory to the ext/ directory of your PHP Source tree, so that there is phproot/ext/vld/ .
After you copied it, go to the PHP source root and issue the not need to unpack the tarball inside the PHP source code tree.
Remove the configure file: rm configure
Rebuild the configure script: ./buildconf
Now run ./configure with the options you want, and add –enable-vld. Using vld does of course only make sense if you run PHP as CLI or CGI.