~/talk

Extending the PHP Language with Static Analysis- Dave Liddament

Talkat PHP UK Conference 2023 · 2023-02-14..02-16· [php, testing]
slides:none on file

Claims that you can prototype real language features using static analysis and attributes and demonstrates it end to end: uses PHPStan plus Nikita’s PHP parser to walk the AST, implements a custom rule that forbids calling TextMessageSender::sendMessage except from TextMessageQueueProcessor, then replaces hard‑coded config with a friend attribute and a small reflection check. Shows the PHP Language Extension library (friend, package, injectable, test_tag), notes type info is required, and that the implementation is a few dozen lines wired into CI.

AI-written summary · about

  1. 0:00Extending PHP with static analysis
  2. 3:09Solving constraints with static analysis
  3. 6:39RFC process and static analysis
  4. 11:17Deep dive into AST
  5. 15:07Custom PHPStan rule step by step
  6. 21:25Implementing friend attribute
  7. 27:05Making rule generic and reusable
  8. 35:25PHP Extension Library
  9. 43:56Communicating intent with new features
  10. 47:49Benefits and future of static analysis
  11. 51:55Q&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.