3.3. Iterator
3.3.2. Examples
- to process a file line by line by just running over all lines (whichhave an object representation) for a file (which of course is anobject, too)
Standard PHP Library (SPL) defines an interface Iterator which is bestsuited for this! Often you would want to implement the Countableinterface too, to allow on your iterable object
3.3.4. UML Diagram
You can also find this code on GitHub
BookList.php