It Feels Great to Iterate

It Feels Great to Iterate

Iterators are an awesome and important feature of PHP, and PHP comes with a lot of them built in too. Let’s talk about what they are, how they’re used, and how to make your own. Then we'll talk about generators, which is really cool PHP 5.5+ feature that takes iterators to the next level. And… we can’t talk about iterators without also discussing the Decorator design pattern. After all, most of the SPL iterator classes are decorators too. It’s never felt so great to iterate! May the foreach be with you!

Ca57a7cfac69ba3abf517470f3770aae?s=128

Jeremy Lindblom

April 07, 2015
Tweet