PHP, Under The Hood
summary
A PHP reimplementation called PHPPHP compiles PHP source (lex → parse → compile) into PHP-specific opcodes, runs them on a simple executor loop, and models zval refcounting and copy‑on‑write so you can inspect actual behavior without C. The demo explains why an opcode cache is hard (compilation is not idempotent, inheritance and runtime state matter), shows the SAPI/startup/request/shutdown lifecycle, and reports PHPPHP passing about 55-60% of the core language tests.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:33Dynamic vs Weak Type
- 2:29Implementation Defined
- 2:57PHP Implementations
- 3:28PHP Compiler
- 5:56PHP Engine
- 10:56Code Compilation
- 13:01Parse
- 13:58Compiler
- 14:22Opcodes
- 15:05PHP Opcodes
- 16:01PHP Opcodes Cache
- 17:43PHP Execution
- 18:48PHP Add Spec
- 19:41PHP ZVal
- 23:59Get Involved








