<?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>Tue, 18 Jun 2013 16:06:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: IteratorIterator - PHP Inconsistencies And WTFs]]></title>
      <guid>http://www.phpdeveloper.org/news/17071</guid>
      <link>http://www.phpdeveloper.org/news/17071</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has a new post to his blog sharing some <a href="http://blog.ircmaxell.com/2011/10/iteratoriterator-php-inconsistencies.html">inconsistencies with iterators</a> that he discovered as discussed with a <a href="http://twitter.com/#!/go_oh">fellow developer</a> - why some iterators only accept Iterator arguments and others don't.
</p>
<blockquote>
We were talking about why some of the SPL Iterators accept only an Iterator as the constructor argument (Such as <a href="http://us2.php.net/manual/en/class.limititerator.php">LimitIterator</a>), and others accept either an Iterator or an IteratorAggregate as the argument (Such as <a href="http://us2.php.net/manual/en/class.iteratoriterator.php">IteratorIterator</a>).  Feeling that this would be a useful feature to add (having all of them accept an IteratorAggregate), I opened up the PHP source and started looking at how hard of a change this would be.  What I found was... Interesting...
</blockquote>
<p>
He shares some of the C code he came across in his investigation including a "WTF" moment when he found a <a href="http://lxr.php.net/xref/PHP_5_3/ext/spl/spl_iterators.c#1418">case statement for DIT_IteratorIterator</a> in a constructor. Because of some of the logic in this constructor, the inputted iterator is "cast down" to a class. This is shown in a few code examples comparing simple iteration objects and arrays and how it seems to be able to bypass class inheritance to use methods from other classes.
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 12:58:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Launch of CSI:PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16567</guid>
      <link>http://www.phpdeveloper.org/news/16567</link>
      <description><![CDATA[<p>
<i>Jeremy Kendall</i> has started up a new blog that's a sort of "WTF in PHP" listing of some of the random (and bad) code that he comes across daily - <a href="http://csiphp.com/blog/">CSI:PHP</a>.
</p>
<blockquote>
It all began with a new gig and an amazingly horrific codebase.  I began tweeting the <a href="http://twitter.com/#!/JeremyKendall/status/55692255276711936">most unbelievable</a>, <a href="http://twitter.com/#!/JeremyKendall/status/83592096224780288">most frustrating snippets</a> I could find.  After quite a few of those tweets, Chris Hartjes replied with, "Looking at your tweets I cannot even fathom what your job is. CSI:PHP ?"  A concept was born.
</blockquote>
<p>
Some of the posts so far include <a href="http://csiphp.com/blog/2011/07/05/eval-hell/">eval() hell</a>, a <a href="http://csiphp.com/blog/2011/07/06/really-preg_replace/">bad use of preg_replace</a> and a bad method <a href="http://csiphp.com/blog/2011/07/07/oh-thats-where-the-mail-function-is-called/">for calling mail()</a>. Currently there's not a way for others to contribute their own code WTFs, but from what I hear it's possible for the future.
</p>]]></description>
      <pubDate>Fri, 08 Jul 2011 10:08:12 -0500</pubDate>
    </item>
  </channel>
</rss>
