(Re)Discovering The SPL
summary
Claim: SPL is powerful but poorly documented so people misuse it. Shows concrete patterns: compose DirectoryIterator + RegexIterator + LimitIterator to keep business logic out of loops and make filters testable; explains surprising pitfalls like LimitIterator lacks Countable (count breaks when wrapped) and that seekable iterator lets LimitIterator skip to offset for big skips; highlights confusing names and bugs such as SPL autoload_unregister wipes autoload stack, ArrayObject reference semantics, and CachingIterator acting as look‑ahead rather than reliable cache.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 1:00SPL Documentation
- 3:38Traversable
- 5:37Iterator
- 13:18Countable
- 18:28Iterating
- 18:57PHP Source Code
- 21:13Iterators
- 21:46Iterator Aggregate
- 23:25Something Iterator
- 23:47Recursive Iterator
- 26:46Recursive Filter Iterator
- 28:12Lookahead Iterator
- 31:12SPL Iterators
- 32:06SPL Arrays
- 32:31SPL Data Structures
- 33:09Big O Notation
- 38:05SPL Object Storage
- 40:39SPL Exceptions
- 41:34Logic Exceptions
- 43:07Runtime Exceptions
- 44:39Never throw exception
- 46:51Miscellaneous stuff
- 47:40Autoloader
- 49:38Area Objects
- 51:15How to make the SPL easier








