ZEND_VM ======= ZEND_VM architecture allows specializing opcode handlers according to op_type fields and using different execution methods (call threading, switch threading and direct threading). As a result ZE2 got more than 20% speedup on raw PHP code execution (with specialized executor and direct threading execution method). As in most PHP applications raw execution speed isn't the limiting factor but system calls and database calls are, your mileage with this patch will vary. Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can find opcode handlers and helpers. The typical opcode handler template looks like this: ZEND_VM_HANDLER(, , , ) { } is a opcode number (0, 1, ...) is an opcode name (ZEN_NOP, ZEND_ADD, :) & are masks for allowed operand op_types. Specializer will generate code only for defined combination of types. You can use any combination of the following op_types UNUSED, CONST, VAR, TMP and CV also you can use ANY mask to disable specialization according operand's op_type. is a handler's code itself. For most handlers it stills the same as in old zend_execute.c, but now it uses macros to access opcode operands and some internal executor data. You can see the conformity of new macros to old code in the following list: EXECUTE_DATA execute_data ZEND_VM_DISPATCH_TO_HANDLER() return _helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) ZEND_VM_DISPATCH_TO_HELPER() return (ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) ZEND_VM_DISPATCH_TO_HELPER_EX(,,) return (, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) ZEND_VM_CONTINUE() return 0 ZEND_VM_NEXT_OPCODE() NEXT_OPCODE() ZEND_VM_SET_OPCODE( SET_OPCODE( ZEND_VM_INC_OPCODE() INC_OPCOD() ZEND_VM_RETURN_FROM_EXECUTE_LOOP() RETURN_FROM_EXECUTE_LOOP() ZEND_VM_C_LABEL(