<?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 06:40:30 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara: Is Autoloading A Good Solution?]]></title>
      <guid>http://www.phpdeveloper.org/news/18255</guid>
      <link>http://www.phpdeveloper.org/news/18255</link>
      <description><![CDATA[<p>
In his <a href="http://blog.ircmaxell.com/2012/07/is-autoloading-good-solution.html">most recent post</a> <i>Anthony Ferrara</i> takes a look at autoloading - mostly asking the question of whether the problems it has really outweigh the benefits.
</p>
<blockquote>
The real problem that autoloaders solve is to load dependencies. [...] The normal logic that's used to justify autoloading over manual dependency loading in production is that it only loads the classes you need. Therefore you save the parsing costs of classes that you don't need. But surely that additional run-time loading has costs. So I decided to setup a test to see how expensive that additional run-time loading costs us, and to prove whether or not autoloading is worth it in production.
</blockquote>
<p>
He gives an example of the two methods - using the <a href="http://php.net/spl_autoload_register"> spl_autoload_register</a> method to define a loader and loading them with a defined file path instead. He found the autoloading version slower than the hard-coded (by quite a bit) but how, when the number of files is reduced, the performance gets much closer. He also briefly looks at two other pieces of file-related functionality: <a href="http://php.net/file_exists">file_exists</a> and <a href="http://php.net/require_once">require_once</a>.
</p>]]></description>
      <pubDate>Fri, 20 Jul 2012 15:56:30 -0500</pubDate>
    </item>
  </channel>
</rss>
