~/talk

Generics in PHP: Today Already

TalkinRussianat PHPFest 2020 · 2020-10-23..10-24· [php]
slides:none on file

The talk explains how to model generics in PHP today using PHPDoc annotations so static analyzers like PHPStan and Psalm can understand and check parametrized types. It covers the concept of generics, practical use cases for typing collections and avoiding unsafe casts, and how generics are implemented and considered within PHPStan.

AI-written summary · about

  1. 0:00Introduction
  2. 1:35What is PHPStan
  3. 4:31PHP type problems
  4. 4:51What are generics
  5. 6:59How templates work
  6. 10:54Covariance and contravariance
  7. 14:43PHP 7.4 changes
  8. 16:52Solving generic problems
  9. 18:20PHPStan limitations
  10. 19:01Live demo
  11. 23:19Interface binding
  12. 25:30Reflection usage
  13. 27:20PHPDocs and stubs
  14. 28:47PHPStan Pro support
~/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.