<?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>Wed, 22 May 2013 18:04:06 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[MaltBlue.com: Painless Data Traversal with PHP FilterIterators]]></title>
      <guid>http://www.phpdeveloper.org/news/18654</guid>
      <link>http://www.phpdeveloper.org/news/18654</link>
      <description><![CDATA[<p>
On the MaltBlue blog <i>Matt Setter</i> has a new post introducing you to <a href="http://www.maltblue.com/php/painless-data-traversal-with-php-filteriterators">using FilterIterators for data traversal</a>:
</p>
<blockquote>
There's load of ways to traverse data, especially in PHP where there are a variety of loops available; including while, do while, for and foreach. These are fine for normal structures, such as scalar and associative arrays. But what if you want to get a bit more fancy?
</blockquote>
<p>
He includes a bit of code showing the typical looping approach that a lot of developers take and how, using a <a href="http://php.net/filteriterator">FilterIterator</a>, you can extend the default and make a custom "accept" method to remove certain matching items from the data set.
</p>]]></description>
      <pubDate>Thu, 25 Oct 2012 08:54:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Faster Arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/17091</guid>
      <link>http://www.phpdeveloper.org/news/17091</link>
      <description><![CDATA[<p>
In <a href="http://daveyshafik.com/archives/30320-faster-arrays.html">this new post</a> to his blog <i>Davey Shafik</i> looks at an alternative to the traditional <a href="http://php.net/arrays">arrays</a> most scripts use - something a little faster and more specific: <a href="http://php.net/splfixedarray">SplFixedArray</a>, part of the <a href="http://php.net/spl">Standard PHP Library</a> included with every release.
</p>
<blockquote>
The SplFixedArray class provides a super-fast, fixed size array implementation. There are some limitations however, first you must use numeric keys and secondly you cannot use anonymous assignment (i.e. $array[] = 'value';). You'll notice one requirement was missing, that it should have a fixed size. While having a fixed size is what will bring you the speed increase it's actually not a requirement that the size be fixed.
</blockquote>
<p>
Because of these restrictions, the SplFixedArray is faster than its cousin - between 20 and 40 percent faster, depending on the size of the array. He includes a few snippets in the the post - one showing how he benchmarked the differences against simple arrays and another showing a more advanced example with another SPL type, a <a href="http://php.net/filteriterator">FilterIterator</a>.
</p>]]></description>
      <pubDate>Mon, 07 Nov 2011 08:54:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Applying FilterIterator to Directory Iteration]]></title>
      <guid>http://www.phpdeveloper.org/news/14972</guid>
      <link>http://www.phpdeveloper.org/news/14972</link>
      <description><![CDATA[<p>
New on his blog <i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/244-Applying-FilterIterator-to-Directory-Iteration.html">this post</a> looking about using the FilterIterator (from PHP's SPL libraries) to work with (recursive) directory iteration.
</p>
<blockquote>
I'm currently doing research and prototyping for autoloading alternatives in Zend Framework 2.0. One approach I'm looking at involves creating explicit class/file maps; these tend to be much faster than using the include_path, but do require some additional setup. [...] I'm well aware of RecursiveDirectoryIterator, and planned to use that. However, I also had heard of FilterIterator, and wondered if I could tie that in somehow. In the end, I could, but the solution was non-obvious. 
</blockquote>
<p>
He starts with what he thought he should be able to do with the FilterIterator - pass in a DirectoryIterator to be able to filter them recursively. Unfortunately this only worked for the first level, so he looked else where. His solution ultimately involved passing in a RecursiveIteratorIterator instance into the DirectoryIterator that contained his RecursiveDirectoryIterator. He includes a full code example in the post showing how to locate a certain file/class recursively inside a directory.
</p>]]></description>
      <pubDate>Tue, 17 Aug 2010 10:29:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Turland's Blog: A Few Kinks in FilterIterator]]></title>
      <guid>http://www.phpdeveloper.org/news/14963</guid>
      <link>http://www.phpdeveloper.org/news/14963</link>
      <description><![CDATA[<p>
In <a href="http://matthewturland.com/2010/08/15/a-few-kinks-in-filteriterator/">this quick post</a> to his blog <i>Matthew Turland</i> shares a "kink" he found in using the <a href="http://php.net/filteriterator">FilterIteractor</a> SPL iterator when working with <a href="http://phergie.org/2010/08/08/known-issue-in-phergie-2-0-3/">the Phergie project</a>'s code.
</p>
<blockquote>
Once I discovered the <a href="http://en.wikipedia.org/wiki/Segmentation_fault">segfault</a> [from the FilterIterator code], I had to come up with a short code sample exposing the bug in order to report it. 
</blockquote>
<p>
He talks about <a href="http://bugs.php.net/bug.php?id=52559">the bug</a> that led him to the segfault and <a href="http://bugs.php.net/bug.php?id=52560">a second bug</a> that was a side effect of the first causing the first element to be skipped during iteration.
</p>]]></description>
      <pubDate>Mon, 16 Aug 2010 10:18:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPro.org: SPL AppendIterator]]></title>
      <guid>http://www.phpdeveloper.org/news/11588</guid>
      <link>http://www.phpdeveloper.org/news/11588</link>
      <description><![CDATA[<p>
On the PHPro.org website <i>Kevin Waterson</i> has posted <a href="http://www.phpro.org/tutorials/SPL-AppendIterator.html">a look at the AppendIterator</a> iterator, a part of the SPL (Standard PHP Library) that is included with PHP5.
</p>
<blockquote>
The SPL AppendIterator provides a method of iterating over multiple arrays at the same time. This can be very useful when aggregating data from different sources, such as XML or RSS feeds or even multiple database sources. The flexibility and efficiency of the whole SPL suite of tools is a the disposal of the AppendIterator making manipulating data in multiple objects fast and simple with a minimum of code.
</blockquote>
<p>
His example shows what an AppendIterator object looks like, how to use it to add new values to an array and how to filter values out of the append process with a FilterIterator object.
</p>]]></description>
      <pubDate>Wed, 17 Dec 2008 11:19:32 -0600</pubDate>
    </item>
  </channel>
</rss>
