O'Reilly logo

Mastering the SPL Library by Joshua Thijssen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Iterators

Even though technically the “iterator” itself isn’t part of the SPL, iterators in the PHP world probably have become famous thanks to the SPL. This is because the SPL is mainly known for its large set of iterators. And even though they have strange names like IteratorIterator, or even RecursiveIteratorIterator, they all do serve a purpose. This chapter introduces you to all the SPL iterators, what their functions are and how to use them with the help of some examples.

In order to understand how the iterator interface works, please take a look at the interface inside the “SPL Interfaces” chapter. To reflect the layout of the PHP.net manual, this chapter comes after this iterator chapter, and also discusses some other non-SPL interfaces ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required