Marcel Pociot :: Parsing PHP for Fun...and Profit
summary
Demonstrates concrete use of PHP-Parser (nikic) to parse code into ASTs, then mutates files with a node traverser and visitors: change every string, append a package Class::class into a merged providers array, strip debug dumps by removing nodes, and wrap echo nodes into an internal dump via Builder Factory so Tinkerwell can render outputs as cards. Live examples parse, modify, and pretty‑print PHP source and the demo transformations succeed end to end.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:49What is a parser
- 6:24PHP parser in userland
- 7:48Exploring parser with demos
- 11:01Modifying strings in PHP
- 14:54Appending to config arrays
- 18:09Removing dump calls
- 20:40Wrapping echo in functions
- 23:53Closing thoughts & Q&A








