News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Engine Yard Blog:
The Outer Iterator
January 13, 2014 @ 11:45:08

On the Engine Yard blog they have a new tutorial posted by Cal Evans looking at an object offered by the Standard PHP Library - the OuterIterator.

When PHP 5 arrived there was great excitement and rejoicing over the new object model. For many of us who struggled through PHP 4′s "Object Based" paradigm, PHP 5 was a ray of sunshine. We were so excited that many of us lost sight of another important addition to PHP 5, the Standard PHP Library (SPL).

Since then, the excitement over the object model has died down. Many authors and speakers have talked about, blogged about, and written about the SPL. However the SPL itself is a very large topic. We are going to narrow our focus down a bit to a subtopic of a specific section of the SPL. This blog post will deal with the OuterIterator. This is an interface defined in the SPL and used by several of the built in iterators.

He goes on to give a brief introduction about what the OuterIterator is and some examples uses for it, including one of the easier to follow - using it with a FilterIterator-based class. He gets into more detail about how the OuterIterator works and includes example snippets to help clarify. His "DwarfPrinter" class extends the FilterIterator and echoes out the names of The Seven Dwarves. He also includes an example of the output showing a more formatted output that follows the nesting and execution of the iterator. He finishes off the post with a list of iterators are useful to pair with the OuterIteator.

0 comments voice your opinion now!
outeriterator tutorial filteriterator standardphplibrary spl

Link: https://blog.engineyard.com/2014/the-outer-iterator

blog comments powered by Disqus

Similar Posts

DevShed: Building Helpers in PHP 5

PHPMaster.com: Rapid Application Development with CakePHP

Dave Dash's Blog: Saving a file to a database using symfony and doctrine

Andrew Podner: Lithium: Building Views Using Layouts

DevShed: Working with Directory Iterators and Proxy Classes with PHP 5


Community Events





Don't see your event here?
Let us know!


code introduction community list laravel testing configure release podcast install language series framework developer symfony2 unittest threedevsandamaybe opinion interview refactor

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework