Static Optimization of PHP Bytecode
summary
PHP 7.1 adds an SSA-based optimization infrastructure and type inference that enables specialization of opcodes and some constant-folding; the implementation lands SSA, type analysis and simple specialization in the Zend VM but inlining and whole-program constant propagation are withheld. Microbenchmarks show up to ~1.5× speedups, but real apps like WordPress and MediaWiki see ~1–3% gains; a new JIT (ASM backend) gives roughly ~5% on WordPress. Dynamic features—eval, references, error handlers, includes/destructors—make many optimizations unsafe.
AI-written summary · about
chapters (11)
- 0:00Start
- 4:22Classes of Optimizations
- 6:04Generic Add Instruction
- 8:32Classical Compiler Optimizations
- 9:02Code Elimination
- 10:24Constant Propagation
- 15:50Behind the Type Inference
- 19:17Range Inference
- 27:40Error Handler
- 34:15Results
- 35:17Average Improvement








