<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 13:06:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara: Iterators - Programming With Anthony]]></title>
      <guid>http://www.phpdeveloper.org/news/19051</guid>
      <link>http://www.phpdeveloper.org/news/19051</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> is back again with another installment in his "Programming with Anthony" video series. In <a href="http://blog.ircmaxell.com/2013/01/todays-programming-with-anthony-video.html">this new episode</a> he takes a loot at <a href="http://php.net/manual/en/class.iterator.php">iterators</a> in PHP and how they can be used effectively.
</p>
<blockquote>
Today's Programming With Anthony video focuses on the concept of Iterators. We'll look at the abstraction that they represent, how they can be used and some of the benefits of using them. When used correctly, Iterators can lead to very efficient, flexible and clean code. 
</blockquote>
<p>
You can also watch the video <a href="http://www.youtube.com/watch?feature=player_embedded&v=tW6GcZjBc3E">directly on YouTube</a> and check out the rest of the series in <a href="https://www.youtube.com/playlist?list=PLM-218uGSX3DQ3KsB5NJnuOqPqc5CW2kW&feature=view_all">his playlist</a>. Other topics include dependency injection, boolean logic and prepared statements.
</p>]]></description>
      <pubDate>Thu, 17 Jan 2013 10:38:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using SPL Iterators, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17986</guid>
      <link>http://www.phpdeveloper.org/news/17986</link>
      <description><![CDATA[<p>
On PHPMaster.com today they've posted the <a href="http://phpmaster.com/using-spl-iterators-2/">second part of the series</a> covering the Iterators that come with PHP as a part of the <a href="http://php.net/spl">SPL</a>.
</p>
<blockquote>
In <a href="http://phpmaster.com/using-spl-iterators-1">part one</a> of this series I introduced you to some of the SPL Iterators and how to use them. There may be times however when the provided iterators are insufficient for your needs and you'll want to roll your own custom iterator. Luckily, SPL provides interfaces that will allow you to do just that. For an object to be traversable in a foreach loop, PHP requires that it be an instance of Traversable. You cannot however implement this interface directly (though you can use it in instaceof checks); instead you'll need to implement either SPL's Iterator or IteratorAggregate interfaces.
</blockquote>
<p>
He shows you how to implement these two interfaces in your own custom classes, looping through a set of books for the Iterator example and a "getIterator" method that creates an <a href="http://php.net/arrayiterator">ArrayIterator</a> when executed. The results of both are used in foreach loops showing how they can be used just like any other iteratable variables.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 08:23:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using SPL Iterators, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17962</guid>
      <link>http://www.phpdeveloper.org/news/17962</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial posted, the first part of a series, looking at the use of the <a href="http://php.net/spl">Standard PHP Library (SPL)</a> in PHP. In <a href="http://phpmaster.com/using-spl-iterators-1/">this first part</a> of the series, <i>Stefan Froelich</i> looks specifically at two of the more common uses for iterators - working with arrays and directories.
</p>
<blockquote>
When I first came across the term iteration and saw the overwhelming list of classes related to it in the SPL, I was taken aback. It seemed maybe iteration was too complex for me to grasp. I soon realized it was just a fancy word for something we programmers do all the time. [...] In the first part of this two-part series I'll introduce you to iteration and how you can take advantage of some of the built-in classes from the Standard PHP Library (SPL).
</blockquote>
<p>
Included in the tutorial is example code showing how to use the <a href="http://php.net/arrayiterator">ArrayIterator</a> to work with an array and the <a href="http://php.net/directoryiterator">DirectoryIterator</a> to process the contents of a directory. He also briefly touches on a few other iterators like "FileExtensionFilter", "RecursiveDirectoryIterator" and "RecursiveArrayIterator".
</p>]]></description>
      <pubDate>Tue, 15 May 2012 12:26:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: 5 great articles on SPL Iterators]]></title>
      <guid>http://www.phpdeveloper.org/news/10781</guid>
      <link>http://www.phpdeveloper.org/news/10781</link>
      <description><![CDATA[<p>
On the PHP::Impact blog today <i>Federico</i> <a href="http://phpimpact.wordpress.com/2008/08/06/5-great-articles-on-spl-iterators/">points out</a> five articles that can help you learn more about the Standard PHP Library, specifically in dealing with iterators.
</p>
<blockquote>
When PHP 5 was initially released, it included a strong sense of standardization introduced in the core package. This can be a real time saver when common programming issues must be solved through proven, standard solutions. That's precisely the case with iterators, since the SPL package includes many predefined iterating classes that can be used for traversing different data structures, without having to reinvent the wheel over and over again.
</blockquote>
<p>
The links include <a href="http://www.phpro.org/tutorials/Introduction-to-SPL.html">this article</a> on phpro.org and <a href="http://devzone.zend.com/article/2565-the-standard-php-library-spl">this one</a> on Zend's own site.
</p>]]></description>
      <pubDate>Thu, 07 Aug 2008 09:35:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Iterators in the Simplest Sense - Traversing Different Data Structures]]></title>
      <guid>http://www.phpdeveloper.org/news/4996</guid>
      <link>http://www.phpdeveloper.org/news/4996</link>
      <description><![CDATA[DevShed has posted the <a href="http://www.devshed.com/c/a/PHP/Iterators-in-the-Simplest-Sense-Traversing-Different-Data-Structures/">second part</a> in their "Iterators in the Simplest Sense" series - this time focusing on traversing different data structures.
<p>
<quote>
<i>
Welcome to the second tutorial of the series "Iterators in the simplest sense." Just in case you didn't know, this series introduces Iterators in PHP 4 - PHP 5, explaining their basic concepts, and teaches you how to use them in practical projects, which can be utilized as part of larger PHP applications.
<p>
By the end of this tutorial, I hope you'll have an accurate idea of how to use a generic Iterator structure. I will show how it is useful for traversing different data structures by providing specific implementations for each of the abstract methods defined within the base Iterator class.
</i>
</quote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Iterators-in-the-Simplest-Sense-Traversing-Different-Data-Structures/">look first</a> at extending the code that they had before by making an interator to work with a MySQL connection. They discuss how it will all work prior to coding (plan first, code later) before moving into the actual coding process and creating the class. The iterator, once extended, provides an interface between you and the normal MySQL functions, making it easier to handle the results from your queries (with things like "countAffectedRows" and "seekRow").]]></description>
      <pubDate>Wed, 15 Mar 2006 12:50:40 -0600</pubDate>
    </item>
  </channel>
</rss>
