Iterators in PHP
summary
Shows concrete claims and working code: uses DirectoryIterator/FileSystemIterator to list files, wraps iterators with FilterIterator and RegexIterator to find or exclude files, uses RecursiveIteratorIterator to build an HTML menu and to delete cache files recursively, demonstrates that CachingIterator acts as a look‑ahead for previous/next navigation, and proves generators via yield (PHP 5.5) remove the heavy iterator boilerplate. Notes: FileSystemIterator skips dots by default and generators save iterator state.
AI-written summary · about
chapters (15)
- 0:00Start
- 3:51Defining an Iterator
- 6:18Iterator Basics
- 7:57Recursive Iterators prepare an iterator to be recursively iterated.
- 13:14Directory Iterator
- 15:07Filesystem Iterator
- 16:13Glob Iterator
- 21:09Regex Iterator
- 22:10Parent Iterator
- 22:30Limit Iterator
- 24:13Callback Filter Iterator
- 26:15Caching Iterator
- 31:00Testing Iterators
- 31:29Iterator Functions
- 32:35Questions? Concerns? Complaints?
related talks
35mInterators + Generatiors: The Road to Virtual Infinite RAM
34mLooping the Loop with SPL Iterators
01h 03mNever* use arrays
59m(Re)Discovering The SPL
55mFantastic functions and where to find them
48mCooperative multitasking with generators
25mCrazy Fun Experiments with PHP (Not for Production)
40mCreating generative art with PHP!
