~/talk

Reduce boilerplate code with PHP 8

Talkat International PHP Conference Berlin 2026 · 2026-06-08..06-12· [php]
slides:none on file

Demonstrates concrete PHP 8/8.1 changes that cut boilerplate: removing redundant docblocks, using constructor property promotion to drop repeated names from four occurrences to one, switching getters/setters to readonly properties (writes after construction trigger a fatal error), replacing switch blocks with the match expression that returns values, using the nullsafe operator to safely return null for missing nested objects, and using named arguments; recommends phpcs-fixer and Rector for automated transforms.

AI-written summary · about

  1. 0:00Start
  2. 2:18Doc Blocks
  3. 8:07Attributes
  4. 9:12Why Do We Use Getters
  5. 9:42Read-Only Properties
  6. 13:02Immutable Objects
  7. 13:26Read Only Properties
  8. 17:50Match Expression
  9. 18:55Null Safe Operator
  10. 20:02Named Arguments
  11. 21:17Recap
  12. 22:06Constructor Variables
  13. 24:00Live Coding
  14. 25:53Type Hinting
  15. 29:34Remove All the Getters and Setters
~/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.