<?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>Thu, 20 Nov 2008 04:58:33 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Moon's Blog: in_array is quite slow]]></title>
      <guid>http://www.phpdeveloper.org/news/10357</guid>
      <link>http://www.phpdeveloper.org/news/10357</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> had <a href="http://brian.moonspot.net/2008/06/05/in_array-is-quite-slow/">a problem</a> - one of his cron jobs was lasting for much longer (hours!) than it should have been. He tweaked, tested and debugged the script and finally came down to a call to <a href="http://www.php.net/in_array">in_array</a>, something he comments on as being "quite slow".
</p>
<blockquote>
See, this job is importing data from a huge XML file into MySQL.  After it is done, we want to compare the data we just added/updated to the data in the table so we can deactivate any data we did not update. [...] We then compared the two arrays by looping one array and using in_array() to check if the value was in the second array. [...] So, that was running for hours with about 400k items.  Our data did not contain the value as the key, but it could as the value was unique.  
</blockquote>
<p>
He method, replacing the in_array call that had to do a full array scan for each time through the loop with an isset/unset combo on the unique key, changed the execution time down from about 4 hours to 0.8 seconds.
</p>]]></description>
      <pubDate>Fri, 06 Jun 2008 09:36:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Thompson's Blog: 7 PHP functions that saved my life]]></title>
      <guid>http://www.phpdeveloper.org/news/9468</guid>
      <link>http://www.phpdeveloper.org/news/9468</link>
      <description><![CDATA[<p>
On his blog, <i>Phil Thompson</i> lists <a href="http://imgiseverything.co.uk/2008/01/18/7-php-functions-that-saved-my-life/">seven PHP functions</a> that "saved his life" when developing his apps:
</p>
<blockquote>
From time to time, I've struggled with minor pieces of coding for what seems like an age and then I've discovered PHP has a ready-made function whose express purpose seems to be to fix my exact problem. Today, I name and honour those PHP functions which saved my life, my career and my sanity.
</blockquote>
<p>Functions that made the cut include:</p>
<ul>
<li><a href="http://php.net/number_format">number_format</a>
<li><a href="http://php.net/array_values">array_values</a>
<li><a href="http://php.net/isset">isset()</a>
<li><a href="http://php.net/array_diff">array_diff()</a>
</ul>
<p>
He has his own reasons for each - all of them being handy little functions that fill a specific niche in PHP's vast array of abilities.
</p>]]></description>
      <pubDate>Tue, 22 Jan 2008 11:08:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Thompson's Blog: 7 PHP functions that saved my life]]></title>
      <guid>http://www.phpdeveloper.org/news/9470</guid>
      <link>http://www.phpdeveloper.org/news/9470</link>
      <description><![CDATA[<p>
On his blog, <i>Phil Thompson</i> lists <a href="http://imgiseverything.co.uk/2008/01/18/7-php-functions-that-saved-my-life/">seven PHP functions</a> that "saved his life" when developing his apps:
</p>
<blockquote>
From time to time, I've struggled with minor pieces of coding for what seems like an age and then I've discovered PHP has a ready-made function whose express purpose seems to be to fix my exact problem. Today, I name and honour those PHP functions which saved my life, my career and my sanity.
</blockquote>
<p>Functions that made the cut include:</p>
<ul>
<li><a href="http://php.net/number_format">number_format</a>
<li><a href="http://php.net/array_values">array_values</a>
<li><a href="http://php.net/isset">isset()</a>
<li><a href="http://php.net/array_diff">array_diff()</a>
</ul>
<p>
He has his own reasons for each - all of them being handy little functions that fill a specific niche in PHP's vast array of abilities.
</p>]]></description>
      <pubDate>Tue, 22 Jan 2008 08:12:50 -0600</pubDate>
    </item>
  </channel>
</rss>
