<?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>Sun, 26 May 2013 04:10:24 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Joshua Thijssen: PHP5.5: Try/Catch/Finally]]></title>
      <guid>http://www.phpdeveloper.org/news/19169</guid>
      <link>http://www.phpdeveloper.org/news/19169</link>
      <description><![CDATA[<p>
<i>Joshua Thjissen</i> has a new post to his site today about a feature that's been introduced in the upcoming PHP 5.5 release of the language - the addition of "finally" to try/catch exception handling. He gets into it <a href="http://www.adayinthelifeof.nl/2013/02/12/php5-5-trycatchfinally/">a bit more technically</a> than just the "introductory" level, discussing parent/child exception handling and using returns.
</p>
<blockquote>
Exception handling is available in PHP since version 5.  It allows you to have a more fine-grained control over code when things go wrong ie, when exceptions occur. But since PHP 5.5, exception handling has finally evolved into what it should have been from the beginning: the "finally" part has been implemented.
</blockquote>
<p>
He includes a basic example showing how a certain part is always executed, regardless of if the exception is thrown or not. He also shows how a "chained catch" would work to catch multiple kinds of exceptions and when the "finally" is run as it relates to the "trickle down" handling of exceptions. He then gets a little more complex and introduces "return" into the mix. Of special note, even if you return, the "finally" will still get called.
</p>]]></description>
      <pubDate>Tue, 12 Feb 2013 10:03:23 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Aaron McGowan: Finally generators exist as of PHP 5.5]]></title>
      <guid>http://www.phpdeveloper.org/news/19053</guid>
      <link>http://www.phpdeveloper.org/news/19053</link>
      <description><![CDATA[<p>
In <a href="http://www.amcgowan.ca/articles/software-development/php/finally-generators-exist-as-of-php-5-5">this new post</a> to his site <i>Aaron McGowan</i> talks about new features of the upcoming PHP 5.5 release - the "finally" keyword and generators.
</p>
<blockquote>
PHP 5.5 has recently been released as an ALPHA release, meaning there are still bugs, code is being tested and features being added. With the 5.5 release, many of us PHP developers have a few wonderful new features that we should be taking advantage of almost immediately.
</blockquote>
<p>
He gives brief introductions to these two new features, including some code examples (but getting a bit more into the generators side of things). You can find out more about these two features and how to implement them when PHP 5.5 comes around from the PHP sitel: <a href="http://us2.php.net/generators">generators</a> and <a href="https://wiki.php.net/rfc/finally">finally</a> (actually from the PHP wiki).
</p>]]></description>
      <pubDate>Thu, 17 Jan 2013 12:37:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sherif Ramadan: Finally Getting finally In PHP?]]></title>
      <guid>http://www.phpdeveloper.org/news/18339</guid>
      <link>http://www.phpdeveloper.org/news/18339</link>
      <description><![CDATA[<p>
In <a href="http://sheriframadan.com/2012/08/finally-keyword-in-php/">this recent post</a> to his site <i>Sherif Ramadan</i> looks at a proposal that's currently under view (RFC) to <a href="https://wiki.php.net/rfc/finally">add the "finally" keyword</a> to PHP.
</p>
<blockquote>
It's quite possible that PHP may finally be getting the addition of the finally block in its try/catch block. [...]  It also solves a simple, but overlooked problem for the developer. With finally we offer the user-space code a chance to do any clean up work that may be necessary after a try block has terminated execution and with clear semantics.
</blockquote>
<p>
He includes a use case for this feature - an example showing exception handling on multiple levels and writing to log files when the cleanup of the exception is finished (without the potential for another method to trigger the exception itself). "Finally" allows you to take this logic out of the exception handling and put it at the end, removing the possibility of it triggering an exception for the wrong reason. There's a few other examples showing some other quirks with its usage - like calling <a href="http://php.net/die">die</a> will not make it end up in the "finally".
</p>]]></description>
      <pubDate>Thu, 09 Aug 2012 10:53:55 -0500</pubDate>
    </item>
  </channel>
</rss>
