<?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, 23 May 2013 04:32:36 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: HashTables]]></title>
      <guid>http://www.phpdeveloper.org/news/15000</guid>
      <link>http://www.phpdeveloper.org/news/15000</link>
      <description><![CDATA[<p>
<i>Johannes Schluter</i> has <a href="http://schlueters.de/blog/archives/142-HashTables.html">a new post</a> to his blog on another PHP internals related topic - hashtables.
</p>
<blockquote>
While preparing my "<a href="http://phpconference.nl/schedule/talks#phphood">PHP Under The Hood</a>" talk for the Dutch PHP Conference there was a question on IRC about <a href="http://php.net/extension_loaded">extension_loaded</a>() being faster than <a href="http://php.net/function_exists">function_exists</a>(), which might be strange as both of them are simple hash lookups and a hash lookup is said to be O(1). I started to write some slides for it but figured out that I won't have the time to go through it during that presentation, so I'm doing this now.
</blockquote>
<p>
He talks about array storage (a "real" array), numeric and string-based keys, the internals of how each is stored and how the differences make the one function faster than the other (hint: it's all <a href="http://schlueters.de/~johannes/php/collisions.txt">about collisions</a>).
</p>]]></description>
      <pubDate>Mon, 23 Aug 2010 08:58:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: How to Handle Unloaded PHP Extensions at Runtime]]></title>
      <guid>http://www.phpdeveloper.org/news/14253</guid>
      <link>http://www.phpdeveloper.org/news/14253</link>
      <description><![CDATA[<p>
On the SitePoint PHP blog today <i>Craig Buckler</i> has a suggestion on <a href="http://www.sitepoint.com/blogs/2010/03/26/php-extension-not-loaded/">how to handle unloaded extensions</a> in your application in case you need to define a failover.
</p>
<blockquote>
Unless you're creating very simple applications, you will soon require one or more PHP extensions. Extensions are code libraries which extend the core functionality of the language. [...] What happens when you want to move your web application to another host or platform where a different set of extensions are configured?
</blockquote>
<p>
Using the <a href="http://www.php.net/manual/en/function.extension-loaded.php">extension_loaded</a> function built into PHP, you can create intelligent code that can fall back on a different technology if needed. In his example its trying to check for the GD graphics extension and echoing and error message if it's not found. The <a href="http://www.php.net/manual/en/function.function-exists.php">function_exists</a> function can be used similarly.
</p>]]></description>
      <pubDate>Fri, 26 Mar 2010 09:10:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Larry Garfield's Blog: Drupal 7 gets introspective code registry]]></title>
      <guid>http://www.phpdeveloper.org/news/10143</guid>
      <link>http://www.phpdeveloper.org/news/10143</link>
      <description><![CDATA[<p>
<i>Larry Garfield</i> talks about a new feature of Drupal 7 in <a href="http://www.garfieldtech.com/drupal-7-registry">a new post</a> to his blog - the new introspective code registry that's been introduced in this latest version.
</p>
<blockquote>
As a GHOP Task , Cornil did a performance analysis of Drupal and found its two largest performance drains were the bootstrap process and the theming layer. Quite simply, Drupal spends too much time including code. [...] Fortunately, Drupal 7's self-learning <a href="http://drupal.org/node/221964">code registry system</a> has <a href="http://drupal.org/cvs?commit=114916">just</a> <a href="http://drupal.org/cvs?commit=114932">landed</a>, which should obliterate most of the wasted bootstrap cost.
</blockquote>
<p>
<i>Larry</i> <a href="http://www.garfieldtech.com/drupal-7-registry">describes</a> the "heart of it all", the token_get_all call, that parses through an entire PHP file, splitting out things like classes included and functions called. This is passed through a function_exists call to the current script and, if it's already there, the file isn't included repetitively.
</p>]]></description>
      <pubDate>Thu, 08 May 2008 12:53:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[EdFinkler's Blog: Determining if a function is *really* available in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7523</guid>
      <link>http://www.phpdeveloper.org/news/7523</link>
      <description><![CDATA[<p>
In <a href="http://funkatron.com/wp/archives/php/determining-if-a-function-is-really-available-in-php/">this new post</a> to his blog, <i>Ed Finkler</i> talks about some tests he worked up to discover if a function is available in PHP or not while working on the latest version of <a href="http://phpsecinfo.com/">PHPSecInfo</a>).
</p>
<blockquote>
is_callable() will return TRUE even if a function has been disabled in php.ini with disabled_functions (which, in my mind, is contrary to what 'is_callable' implies). function_exists() will return FALSE if the function is disabled in php.ini, but will return TRUE if the function is being blocked by safe_mode.
</blockquote>
<p>
So, to help counter these issues, he checks first to see if the exec('id') option works - checking it work function_exists and the setting for safe_mode (disabled). If it doesn't pass, he moves on to the posix_* function and tests then with a function_exists.
</p>]]></description>
      <pubDate>Thu, 29 Mar 2007 07:02:14 -0500</pubDate>
    </item>
  </channel>
</rss>
