~/talk

Interators + Generatiors: The Road to Virtual Infinite RAM

Talkat Dutch PHP Conference 2024 · 2024-03-12..03-15· [php]
slides:none on file

Explains how PHP iterators and generators let code traverse huge collections without loading them into RAM, showing practical combos like InfiniteIterator + LimitIterator to stream 10+ days or terabyte CSVs, and using yield from for adapter delegation. Reports benchmarks: generators run up to 40% faster vs native range and up to 400% faster vs iterator implementations. Cites real uses (Symfony Console, Finder, HTTP Foundation, Doctrine twoIterable, a custom LStream uploader), shows getReturn() for counts and points to Zen generator internals.

AI-written summary · about

  1. 0:00Introduction
  2. 3:40What is a collection
  3. 6:32Iterator design pattern
  4. 10:26Implementing iterators in PHP
  5. 13:00Advanced SPL iterators
  6. 16:37Generators and infinite RAM
  7. 18:04Creating generators in PHP
  8. 22:22Delegated generation
  9. 25:41Optimizing bottlenecks
  10. 27:27Performance benefits
  11. 29:34Generators in libraries
  12. 32:49Why use generators
~/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.