<?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, 21 Aug 2008 15:19:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPImpact Blog: No need for set/get methods in Python]]></title>
      <guid>http://www.phpdeveloper.org/news/10849</guid>
      <link>http://www.phpdeveloper.org/news/10849</link>
      <description><![CDATA[<p>
<i>Federico</i> <a href="http://phpimpact.wordpress.com/2008/08/17/no-need-for-setget-methods-in-python/">compares two languages</a> in this new post to the PHP::Impact blog today - PHP and Python - in their need for "getters" and "setters".
</p>
<blockquote>
Python code doesn't typically use the get and set methods so common in PHP. Normally, when writing PHP code, you carefully protect your instance variables by making them private, so callers can only interact with them via getter and setter methods. [...] Python's solution to this problem is more readable, it has a construct called a "property".
</blockquote>
<p>
He compares two blocks of code that do the same thing - set properties on the object with the PHP side doing a bit more error checking (seemingly) than the Python side. They both apply a title property to a book object.
</p>]]></description>
      <pubDate>Mon, 18 Aug 2008 12:06:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Toomas Romer's Blog: Case study: Is PHP embarrassingly slower than Java?]]></title>
      <guid>http://www.phpdeveloper.org/news/10755</guid>
      <link>http://www.phpdeveloper.org/news/10755</link>
      <description><![CDATA[<p>
In a <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">case study</a> posted to his blog, <i>Toomas Romer</i> wonders if a PHP script is embarrassingly slower than than its Java counterpart.
</p>
<blockquote>
The problem. The PHP implementation [of the <a href="http://firestats.cc/wiki/ip2c">IP2C library</a>] is a lot slower. Embarrassingly slower. Without any caching the Java version is able to do ~6000 queries per second. The PHP counterpart can push through ~850 queries. The implementations are the same. The stats provided by the author of the library are 8000 vs 1200. So about the same as my measurements.
</blockquote>
<p>
He details the script, showing <a href="http://dow.ngra.de/wp-content/uploads/2008/08/vanilla1.png">what parts</a> the script is taking up the most time on. A large part of the execution is tied up in IO and the fseek/fread and readShort/readInt functions take up a good chunk. 
</p>
<p>
He even tries removing the functions and making things a bit more streamlined. This helps, but still lags behind its Java brother. Check out <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">the post</a> for more statistics comparing the two.
</p>]]></description>
      <pubDate>Mon, 04 Aug 2008 12:02:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Francois Zeninotto's Blog: Comparing Propel, Doctrine and sfPropelFinder ]]></title>
      <guid>http://www.phpdeveloper.org/news/10568</guid>
      <link>http://www.phpdeveloper.org/news/10568</link>
      <description><![CDATA[<p>
<i>Francois Zeninotto</i> has <a href="http://redotheweb.com/2008/07/08/comparing-propel-doctrine-and-sfpropelfinder/">posted a comparison</a> of three different ORM (Object Relational Mapping) layers for PHP - Propel, Doctrine and sfPropelFinder (the last being a plugin of the <a href="http://www.symfony-project.org/">symfony</a> framework).
</p>
<blockquote>
When it comes to ORMs, it's all a matter of preference. Is it, really? This post compares side-by-side the code required to perform some simple operations with three OO database requesting API. The purpose is to demonstrate that productivity, and not only style, can vary a lot depending on the ORM you choose.
</blockquote>
<p>He's worked up a long list of examples including methods to:</p>
<ul>
<li>Retrieving an article by its primary key
<li>Retrieving the latest 5 articles
<li>Retrieving articles based on a complex AND/OR clause
<li>Retrieving articles authored by people of a certain group
<li>Retrieving an article and its category by the article primary key
<li>Retrieving articles and hydrating their author object and the author group
</ul>
<p>
Each one comes with their own (usually simple) code. His conclusions point out different "bests" of each - like sfPropelFinder being the "most magic" and that some of the limits of Propel are very frustrating.
</p>]]></description>
      <pubDate>Wed, 09 Jul 2008 10:24:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Paranoid Engineering Blog: CMS Battle: Drupal va Joomla va Custom Programming]]></title>
      <guid>http://www.phpdeveloper.org/news/10542</guid>
      <link>http://www.phpdeveloper.org/news/10542</link>
      <description><![CDATA[<p>
On the Paranoid Engineering blog, there's a <a href="http://paranoid-engineering.blogspot.com/2008/07/cms-battle-drupal-vs-joomla-vs-custom.html">recent post</a> with a "CMS battle" of sorts between two of the more popular PHP-based content management systems out there - Drupal and Joomla.
</p>
<blockquote>
It's hard to choose which one to use without trying them out. As usually, there are more options - home grown custom programming or even building your own CMS (which I was once stupid enough to do). Programming from scratch is always fun and beneficial for your skills, however, if you need things up and running in no time or you don't do (or don't want to <a href="http://secma.tigris.org/">do</a>) any programming, using a CMS is the way to go.
</blockquote>
<p>
His vote is for Drupal but he's included <a href="http://paranoid-engineering.blogspot.com/2008/07/cms-battle-drupal-vs-joomla-vs-custom.html">a long list of specs</a> comparing the features of both so you can decide for yourself on which is the better fit.
</p>]]></description>
      <pubDate>Thu, 03 Jul 2008 12:50:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Kimsal's Blog: Addslashes(): don't call it a comeback]]></title>
      <guid>http://www.phpdeveloper.org/news/10401</guid>
      <link>http://www.phpdeveloper.org/news/10401</link>
      <description><![CDATA[<p>
As <i>Michael Kimsal</i> <a href="http://michaelkimsal.com/blog/php-addslashes-alternatives-comparison/">points out</a>, there's a <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">new posting</a> on his brother <i>Mark</i>'s blog talking about alternatives to addslashes() in your applications.
</p>
<blockquote>
I've seen a lot of people talking about mysql_real_escape_string() vs addslashes() vs addcslashes(). There seems to be a lot of real confusion about what these functions do (even with the php.net manual around), especially when it comes to character sets. [...] So, I've decided to lay it all out in a few charts so there is no confusion about what each function does and how each can help protect against SQL injection attacks.
</blockquote>
<p>
He <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">ran some tests</a> based on what the function does to see if it helps with certain things like "escapes with single quotes instead of backslash" and "prevents multi-byte attacks". He compares the speed and testability of the functions as well as provides a multi-byte breakdown oh how the mysql_real_escape_string function works with different character sets.
</p>]]></description>
      <pubDate>Thu, 12 Jun 2008 13:36:20 -0500</pubDate>
    </item>
    <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[SitePoint PHP Blog: PHPBench.com: Live PHP benchmarks, demystifying "best practices"]]></title>
      <guid>http://www.phpdeveloper.org/news/10331</guid>
      <link>http://www.phpdeveloper.org/news/10331</link>
      <description><![CDATA[<p>
In <a href="http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/">this new post</a> to the SitePoint PHP blog <i>Akash Mehta</i> talks about a web application, <a href="http://www.phpbench.com">PHPBench.com</a>, that runs real-time benchmarks comparing some of PHP's own structures (like for versus foreach or echo versus print).
</p>
<blockquote>
The benchmark suite covers all the usual bases, taking a simple task - like iterating over an array - and speed testing almost every possible way to achieve it. Most importantly, however, Chris takes raw numbers out of the spotlight and instead focuses on how the options compare with each other.
</blockquote>
<p>
Since the results are generated live, they'll change a little bit each time the page is loaded. Each also includes a link to the code behind the benchmark so you can test it on your own system easily. 
</p>]]></description>
      <pubDate>Tue, 03 Jun 2008 12:09:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ApacheLounge.com: Memory usage Apache + PHP as module versus FastCGI]]></title>
      <guid>http://www.phpdeveloper.org/news/10264</guid>
      <link>http://www.phpdeveloper.org/news/10264</link>
      <description><![CDATA[<p>
In <a href="http://www.apachelounge.com/forum/viewtopic.php?p=10991">this quick post</a> to the ApacheLounge forum, <i>Steffen</i> shares some stats running PHP in two different methods of running PHP on Apache - mod_php and fastcgi.
</p>
<blockquote>
With PHP as module after some time the memory usage of Apache is growing and growing up to ~800M.<br/>
With mod_fcgid is stays on a steady ~100M <br/>
PHP configuration: only with the extension php_mysql.dll and eaccelerator.dll 
</blockquote>
<p>
<a href="http://www.apachelounge.com/images/httpd-ram-week.png">A graph</a> of the statistics is also provided.
</p>]]></description>
      <pubDate>Mon, 26 May 2008 08:42:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kurt Schrader's Blog: Ruby is a Playground, PHP is a Factory ]]></title>
      <guid>http://www.phpdeveloper.org/news/10255</guid>
      <link>http://www.phpdeveloper.org/news/10255</link>
      <description><![CDATA[<p>
In a <a href="http://kurt.karmalab.org/articles/2008/05/21/ruby-is-a-playground-php-is-a-factory">new post</a> to his blog, <i>Kurt Schrader</i> suggests that the Ruby language feels more like a playground to him and PHP, more of a factory. (note: pro-Ruby article)
</p>
<blockquote>
While reading yet another article on why <a href="http://www.codinghorror.com/blog/archives/001119.html">PHP Sucks (today's witty twist, "but It Doesn't Matter")</a> I realized yet another reason that I'm glad to be programming in Ruby.
</blockquote>
<p>
He sees Ruby as a "big open playground" and languages like PHP as big industrial factories that are more efficient for some things but can also "suck the creativity and life out of the people working in them". He compares a simple bit of Ruby code to PHP code that do essentially the same ask asks why you'd want to do one over the other.
</p>
<p>
There's plenty of <a href="http://kurt.karmalab.org/articles/2008/05/21/ruby-is-a-playground-php-is-a-factory#comments">comments</a> supporting things both ways ranging from "that's a bad example" to "I think PHP is more of a playground - a disorganized mess".
</p>]]></description>
      <pubDate>Fri, 23 May 2008 10:22:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: PHP NetBeans IDE 6.1 is in the house!]]></title>
      <guid>http://www.phpdeveloper.org/news/10233</guid>
      <link>http://www.phpdeveloper.org/news/10233</link>
      <description><![CDATA[<p>
The PHP::Impact blog has a <a href="http://phpimpact.wordpress.com/2008/05/20/php-netbeans-is-in-the-house/">new post</a> about the release of the latest version of the <a href="http://www.netbeans.org/features/web/web-app.html">NetBeans IDE</a>, 6.1.
</p>
<blockquote>
Feature-for-feature, Eclipse and NetBeans are well matched. In fact, because they are both extensible, any feature gaps between the two can be filled in with third-party plug-ins. Eclipse and Netbeans are rapidly approaching the capabilities of commercial offerings. Most developers won't need more than what these two excellent development platforms provide.
</blockquote>
<p>
A (very) brief list of the features of the two is also included, their similarities including SVN support and syntax checking.
</p>]]></description>
      <pubDate>Wed, 21 May 2008 11:17:38 -0500</pubDate>
    </item>
  </channel>
</rss>
