How to get opcodes of PHP?

Check out the Vulcan Logic Disassembler PECL extension – see author’s home page for more info.

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.

Once installed, you can use it like this:

php -d vld.active=1 -d vld.execute=0 -f yourscript.php

See also this interesting blog post on opcode extraction, and the PHP manual page listing the available opcodes.

Leave a Comment