~/talk

Marcel Pociot :: Parsing PHP for Fun...and Profit

Talkat Laracon EU 2024 · 2024-02-05..02-06· [php, open-source, developer-experience]
slides:none on file

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

  1. 0:00Introduction
  2. 1:49What is a parser
  3. 6:24PHP parser in userland
  4. 7:48Exploring parser with demos
  5. 11:01Modifying strings in PHP
  6. 14:54Appending to config arrays
  7. 18:09Removing dump calls
  8. 20:40Wrapping echo in functions
  9. 23:53Closing thoughts & Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.