Climbing the Abstract Syntax Tree
summary
AST introduced in PHP 7 becomes an explicit intermediate data structure that decouples parser and compiler, yielding about 10–15% faster compilation at the cost of higher memory use. Concrete tools demonstrated include php‑ast extension (native, exposes AST), PHP-Parser (userland parser, convenient but slow). Examples built: a tiny lexer/parser/compiler for arithmetic, a class monkey‑patching loader using BetterReflection, and notes on Phan/Exakat static analysis; native AST works and enables real tooling.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:04Climbing the Abstract Syntax Tree
- 29:06Parsing the tokens
- 34:09Executing the AST
- 36:40What does this mean for me?
- 44:01Better Reflection








