<?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>Fri, 24 May 2013 18:42:34 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Community News: Google App Engine now Supports PHP runtime]]></title>
      <guid>http://www.phpdeveloper.org/news/19595</guid>
      <link>http://www.phpdeveloper.org/news/19595</link>
      <description><![CDATA[<p>
On the Google Developers Blog (and lots of places across the web) there's a major update that Google has done for their AppEngine service - the <a href="http://googledevelopers.blogspot.com/2013/05/ushering-in-next-generation-of.html?m=1">introduction of a PHP runtime</a> to their offerings.
</p>
<blockquote>
<a href="https://code.google.com/p/googleappengine/w/list">App Engine 1.8.0</a> is now available and includes a Limited Preview of the <a href="http://cloud.google.com/appengine/php">PHP runtime</a> - your <a href="https://code.google.com/p/googleappengine/issues/list">top requested feature</a>. We're bringing one of the most popular web programming languages to App Engine so that you can run open source apps like Wordpress. It also offers deep integration with other parts of Cloud Platform including <a href="https://cloud.google.com/products/cloud-sql">Google Cloud SQL</a> and Cloud Storage. 
</blockquote>
<p>
You can get more information about how to use this new feature on <a href="https://gaeforphp.appspot.com/">Google App Engine site</a>.
</p>
Link: https://gaeforphp.appspot.com]]></description>
      <pubDate>Thu, 16 May 2013 10:05:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Checking the performance reading arrays with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16724</guid>
      <link>http://www.phpdeveloper.org/news/16724</link>
      <description><![CDATA[<p>
While admitting that micro-optimizations aren't usually worth the time that's taken to worry about them, <i>Gonzalo Ayuso</i> has thrown together some <a href="http://gonzalo123.wordpress.com/2011/08/15/checking-the-performance-reading-arrays-with-php/">array read benchmarks</a> to show the difference, if any, in where array values are fetched.
</p>
<blockquote>
Normally our code is coded once and executed thousands of times, and we must keep in mind that CPU time many times means money. We need to balance it (as always). But, WTH. I like micro-optimizations, and here comes another one: Checking the access to arrays with PHP.
</blockquote>
<p>
He sets up three different options and tests the memory consumption and run time for each:
</p>
<ul>
<li>Referencing a value from a large array outside a for loop
<li>Referencing a value from a large array inside a for loop
<li>Echoing out the value from a large array inside a for loop
</ul>
<p>
Not surprisingly, all three approaches yield just about the same results. It probably has more to do with the size of the large array than how it's accessed. The fetch outside the for loop did come in slightly under the others, but not enough to worry about it.
</p>]]></description>
      <pubDate>Tue, 16 Aug 2011 11:46:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Runtime Classes. A experiment with PHP and Object Oriented Programming]]></title>
      <guid>http://www.phpdeveloper.org/news/16684</guid>
      <link>http://www.phpdeveloper.org/news/16684</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has put together an experiment related to the current OOP structure of PHP - a test <a href="http://gonzalo123.wordpress.com/2011/08/08/runtime-classes-a-experiment-with-php-and-object-oriented-programming/">working with runtime classes</a>, a structure generated entirely when the script is executed and not predefined in the file.
</p>
<blockquote>
Last week I was thinking about creation of a new type of classes. PHP classes but created dynamically at run time. When this idea was running through my head I read the following <a href="http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented">article</a> and I wanted to write something similar. Warning: Probably that it is something totally useless, but I wanted to create a working prototype (and it was fun to do it).
</blockquote>
<p>
His class is pretty basic - a "Human" object that echoes a "hello world" sort of message via a "hello()" method. He creates the classes inside of different test methods to ensure that his assertions are true. The tests check basic output of the "hello()" method, calling undefined methods, testing inheritance and a test creating and evaluating a dynamic function.
</p>
<p>
For something more complex, he creates a dynamic class that solves the <a href="http://codingdojo.org/cgi-bin/wiki.pl?KataFizzBuzz">FizzBuzz</a> kat, a popular programming puzzle. You can find the full code for this and his other examples <a href="https://github.com/gonzalo123/HClass">on github</a>.
</p>]]></description>
      <pubDate>Mon, 08 Aug 2011 09:17:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Weiske's Blog: Visualizing PHPUnit runs]]></title>
      <guid>http://www.phpdeveloper.org/news/16280</guid>
      <link>http://www.phpdeveloper.org/news/16280</link>
      <description><![CDATA[<p>
During some of his development, <i>Christian Weiske</i> found the tests for <a href="http://less-st.sf.net/">a project he was working on</a> too slow for comfort and figured there had to be a way to find the root cause:
</p>
<blockquote>
Running the specific test cases for the part of the application you're working on is easy and fast, but that does not tell you when changes in part A of the app break part B - which happened several times, and all just because I didn't want to wait 45 seconds again and again. So a solution was badly needed; tests should be as fast as possible; preferably < 10 seconds. Before being able to make the slow tests faster, I had to find out which of the 80 tests were slow.
</blockquote>
<p>
Tools like Jenkinks give more detail on test runs, but a normal <a href="http://phpunit.de">PHPUnit</a> install won't. So, he came up with a method that uses <a href="http://phing.info/">Phing</a>'s phpunitreport task to generate extra reporting easily. Here's some example screenshots: <a href="http://cweiske.de/tagebuch/images/phpunitreport/frames-overview.png">test results summary</a>, <a href="http://cweiske.de/tagebuch/images/phpunitreport/frames-error.png">test detail</a> and <a href="http://cweiske.de/tagebuch/images/phpunitreport/single1.png">single page views</a> of the same sort of data.
</p>]]></description>
      <pubDate>Mon, 02 May 2011 10:19:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shay Ben Moshe's Blog: PHP's native array vs SplFixedArray performance ]]></title>
      <guid>http://www.phpdeveloper.org/news/16263</guid>
      <link>http://www.phpdeveloper.org/news/16263</link>
      <description><![CDATA[<p>
<i>Shay Ben Moshe</i> has put together a quick post today where he <a href="http://blog.shay.co/phps-native-array-vs-splfixedarray-performance/">benchmarks array handling performance</a> differences between PHP's native array and the newer SplFixedArray data structure that's a part of the <a href="http://php.net/spl">Standard PHP Library</a> that comes with any recent version of the language.
</p>
<blockquote>
In PHP, arrays are one of the most fundamental data structures.
We use them everywhere.
They are very flexible, because they are implemented as associative arrays, and therefore let us use both string and integer keys. They are also unlimited in size, in most languages arrays are fixed-sized, but this is not the case in PHP. With that in mind, there still is a drawback. It damages performance. The solution for this problem may be SplFixedArray. But, it is not a perfect solution.
</blockquote>
<p>
He points out two major differences - the SplFixedArray is, well, a fixed size and the fact that it can only use integer keys (no associative arrays here). He created three tests to compare the performance of the two:
</p>
<ul>
<li>Writing data to the array
<li>Reading data from the array
<li>Getting a random value from the array
</ul>
<p>
Each of these are measured in terms of runtime and/or memory usage. If you'd like to try out the tests for yourself, you can <a href="http://blog.shay.co/files/arraybenchmark.rar">download the files</a> needed. I won't cover the results of the tests here, though - you'll need to <a href="http://blog.shay.co/phps-native-array-vs-splfixedarray-performance/">visit the post</a> for that!
</p>]]></description>
      <pubDate>Thu, 28 Apr 2011 09:06:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ralph Schindler's Blog: Exception Best Practices in PHP 5.3]]></title>
      <guid>http://www.phpdeveloper.org/news/15140</guid>
      <link>http://www.phpdeveloper.org/news/15140</link>
      <description><![CDATA[<p>
<i>Ralph Schindler</i> has <a href="http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3">put together a new post</a> for his blog about some of the best practices for using exceptions in PHP 5.3 - specifically dealing with some of the new functionality that comes with this latest PHP version.
</p>
<blockquote>
Exception handling in PHP is not a new feature by any stretch. In this article, we'll discuss two new features in PHP 5.3 based around exceptions. The first is nested exceptions and the second is a new set of exception types offered by the SPL extension (which is now a core extension of the PHP runtime). Both of these new features have found their way into the book of best best practices and deserve to be examined in detail.
</blockquote>
<p>
Some of the features he talks about were pre-PHP 5.3, but the focus is largely on these new features. He gives a bit of a background on exception handling in PHP and how custom exceptions could be thrown. He then moves on to the new features - first nesting exceptions and then some about the new core exception types (found <a href="http://us.php.net/manual/en/spl.exceptions.php">here</a>). All that being said, he includes some code to show the dynamic/logic/runtime exceptions in action including a look at best practices in library exception handling.
</p>]]></description>
      <pubDate>Thu, 16 Sep 2010 10:26:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Collecting Garbage: Performance Considerations]]></title>
      <guid>http://www.phpdeveloper.org/news/15117</guid>
      <link>http://www.phpdeveloper.org/news/15117</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has posted <a href="http://derickrethans.nl/collecting-garbage-performance-considerations.html">the third part</a> of his series looking at the garbage collection handling in PHP (the first two parts are here: <a href="http://phpdeveloper.org/news/15049">one</a>, <a href="http://phpdeveloper.org/news/15086">two</a>). In this last part of the series, he'll look at some of the possible performance impacts the garbage collection functionality can have in your applications.
</p>
<blockquote>
In the previous two parts of this column we have explored PHP's take on circular referenced variables and a mechanism that allows to clean up this particular problem with reference counted variable tracking. Of course, the implementation of the garbage collection mechanism in PHP 5.3 has some performance impacts. In this third and last part of the column I will cover the performance implications of the addition of this garbage collection mechanism.
</blockquote>
<p>
He looks at the two possible places that the collection could have an impact - memory usage and run-time delays when the garbage collection routine is fired off and does its job. As before, each of the topics is accompanied by bits of code and a few graphs showing the differences between handling in PHP 5.2 and PHP 5.3 as well as a handy way to get a bit more information out of PHP (using the GC_BENCH CFLAG when compiling).
,/p>]]></description>
      <pubDate>Mon, 13 Sep 2010 11:22:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Drupal4Hu.com: OOP and PHP or why Drupal rocks and some mistakes]]></title>
      <guid>http://www.phpdeveloper.org/news/15010</guid>
      <link>http://www.phpdeveloper.org/news/15010</link>
      <description><![CDATA[<p>
On the Drupal4Hu.com site there's <a href="http://www.drupal4hu.com/node/262">a recent post</a> with a complaint about the OOP functionality in PHP and how Drupal developers should deal with its limitations.
</p>
<blockquote>
While I was always complaining of PHP's inability of adding a method run-time, the problem we face is that you can't replace  one either. So if you do what I did in the previous post, namely use the hook-alter patten (already an addition to PHP, I must say) to override the classname, that works. However, if two modules try to do this for two different methods, you fail.
</blockquote>
<p>
He suggests to those Drupal developers out there that, for version 8 of the popular content management system, they drop the "closed crap that in PHP is called OOP" and work to make something better, implemented themselves. Something that would make it simpler for Drupal developers to create hooks into the main system for their plugins. Be sure to read <a href="http://www.drupal4hu.com/node/262#comments">the comments</a> for other opinions on the post.
</p>]]></description>
      <pubDate>Tue, 24 Aug 2010 11:38:12 -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[Software Development Times: Facebook rewrites PHP runtime]]></title>
      <guid>http://www.phpdeveloper.org/news/13941</guid>
      <link>http://www.phpdeveloper.org/news/13941</link>
      <description><![CDATA[<p>
According to <a href="http://www.sdtimes.com/blog/post/2010/01/30/Facebook-rewrites-PHP-runtime.aspx">this new article</a> from the Software Development Times <a href="http://facebook.com">Facebook</a> has rewritten the PHP runtime from scratch and will be releasing it soon as an open source project.
</p>
<blockquote>
So, why has Facebook rewritten the PHP runtime? Because PHP is obviously too slow for their tastes. A few years ago, I had a coffee meeting with some of the folks from Zend. When they asked what I had been hearing about PHP in the market from my sources, I hemmed and hawed, then told them that I had heard people complaining about how slow PHP was.
</blockquote>
<p>
Other sources suggest the release won't be a full runtime but instead a sort of compiler for PHP applications including <a href="http://therumpus.net/2010/01/conversations-about-the-internet-5-anonymous-facebook-employee/?full=yes">an interview</a> with a Facebook employee who drops a hint about their future plans for the language.
</p>]]></description>
      <pubDate>Mon, 01 Feb 2010 08:09:52 -0600</pubDate>
    </item>
  </channel>
</rss>
