2 parts · Read in order

Reading the engine

How to get opcodes out of PHP, what the dispatch loop does with them, and what the optimizer changed before either happened.

  1. Two tools printed different opcodes for one function

    phpdbg showed thirteen instructions and the optimizer showed nine. Both were right. How to read the notation, and which listing is the one that runs.

    Part 18 min read

  2. The opcode is not the handler

    The same loop ran 23% faster with int parameters, and only with OPcache on. Operand classes pick a handler when the file compiles; proven types pick a different one.

    Part 28 min read

Arrow keys to move, Enter to open.