~/talk

Climbing the Abstract Syntax Tree

Talkat ScotlandPHP 2018 · 2018-10-05..10-06· [php, compilers-and-language-design]
slides:none on file

PHP 7 replaces direct parser-to-opcode generation with an AST that decouples parser and compiler, cutting the compilation step by about 10–15% in measurements and enabling source manipulation. Examples show a toy compiler: a regex lexer, shunting‑yard to RPN, AST builder and tiny VM that executes correctly. Practical tools demonstrated include the php‑ast extension, PHP‑Parser (pure PHP) and BetterReflection for monkey‑patching and static analysis; the approach works and is already underpinning tools like PHPStan and Psalm.

AI-written summary · about

  1. 0:00Introduction
  2. 1:02How PHP works
  3. 10:00Abstract syntax trees
  4. 14:38Benefits of AST
  5. 22:12Building a simple compiler
  6. 31:10Impact on PHP 7
  7. 34:22AST in userland
  8. 41:22Summary and tools
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.