<?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>Wed, 15 Oct 2008 22:09:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: Sub Classing Exceptions in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/11218</guid>
      <link>http://www.phpdeveloper.org/news/11218</link>
      <description><![CDATA[<p>
DevShed has start up a new series today with <a href="http://www.devshed.com/c/a/PHP/Sub-Classing-Exceptions-in-PHP-5/">the first part</a> in a four-part series looking at exception handling in PHP5.
</p>
<blockquote>
If you do any serious programming, whether it's in PHP 5 or some other language, you've needed to know how to handle run time errors and other "exceptional" conditions. You can do this by making your program throw generic exceptions. Or you can unlock the potential of PHP 5 and learn how to create custom exceptions, which is the subject of this four-part series.
</blockquote>
<p>
In this first part they <a href="http://www.devshed.com/c/a/PHP/Sub-Classing-Exceptions-in-PHP-5/1/">get you started</a> with exceptions, showing how to throw them and catch them correctly (try/catch). They put it to good use in an example catching exceptions thrown from a MySQL connection and select.
</p>]]></description>
      <pubDate>Wed, 15 Oct 2008 12:06:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michelangelo van Dam's Blog: Throwing and catching exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/11209</guid>
      <link>http://www.phpdeveloper.org/news/11209</link>
      <description><![CDATA[<p>
<i>Michelangelo van Dam</i> has written up <a href="http://www.dragonbe.com/2008/10/throwing-and-catching-exceptions.html">a quick introductory post</a> on his blog about the process around throwing and catching exceptions in your apps.
</p>
<blockquote>
One thing that I noticed was that although the code was well written [in the Zend Framework], implementing coding standards and best practices on many of the classes, I did notice a wrong usage of throwing exceptions (the try - catch statements).
</blockquote>
<p>
He gives a few examples - catching a "divide by zero" the right and wrong way, how to grab/handle the message that comes along with the exception and how to define your own custom exception handler to help your code do more useful things with the errors it might throw.
</p>]]></description>
      <pubDate>Tue, 14 Oct 2008 14:32:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Priebsch's Blog: Turning errors into exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/10080</guid>
      <link>http://www.phpdeveloper.org/news/10080</link>
      <description><![CDATA[<p>
In a <a href="http://inside.e-novative.de/archives/115-Turning-errors-into-exceptions.html">recent blog entry</a> <i>Stefan Priebsch</i> shows how to take an error thrown by your script and turn it into an exception (to make things like catchable fatal errors).
</p>
<blockquote>
While I would personally prefer an exception to be thrown in the first place, it is pretty easy to convert errors to exceptions in PHP.
</blockquote>
<p>
His example is pretty simple - you set a custom error handler in your script that pulls in the error information and tosses an exception based on the error number the handler is given. Then you can use the try/catch method to see if your script has tossed an exception of the fatal error type. Nice simple solution to handle an interesting little problem.
</p>]]></description>
      <pubDate>Wed, 30 Apr 2008 12:53:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Martynas Jusevicius' Blog: PHP 5 Features: Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/9852</guid>
      <link>http://www.phpdeveloper.org/news/9852</link>
      <description><![CDATA[<p>
On his blog today <i>Martynas Jusevicius</i> <a href="http://www.xml.lt/Blog/2008/03/25/PHP+5+features%3A+Exceptions">talks about</a> a feature that was new in PHP5 - Exceptions:
</p>
<blockquote>
A useful new feature in PHP 5 is <a href="http://devzone.zend.com/node/view/id/1714#Heading5">exception handling</a> via the try/throw/catch paradigm. An exception may be thrown and caught. If an exception is thrown in code surrounded by try, the following statements will not be executed, and the exception will be handled by the first matching catch block.
</blockquote>
<p>
He gives a high-level overview of how Exceptions in PHP5 work and includes a simple example from his work with his <a href="http://www.xml.lt/Resources/Framework">DIY Framework</a>.
</p>]]></description>
      <pubDate>Tue, 25 Mar 2008 10:21:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: The Story and Rebirth Of Zend_Service_Audioscrobbler, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/9285</guid>
      <link>http://www.phpdeveloper.org/news/9285</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has <a href="http://www.littlehart.net/atthekeyboard/2007/12/18/the-story-and-rebirth-of-zend_service_audioscrobbler-part-2/">posted again</a> about the "rebirth" of a Zend Framework component he's worked on - the Zend_Service_Audioscrobbler.
</p>
<blockquote>
So, dear readers, I received some nice emails and comments from those you have used Zend_Service_Audioscrobbler, along with having a nice email conversation with Wil Sinclair from Zend.
</blockquote>
<p>
He still wants to "rip things up and start over", but has decided on a slightly different route - mapping the older function calls to the new ones via a __call catch and including a message stating that the older function call would be deprecated.
</p>]]></description>
      <pubDate>Thu, 20 Dec 2007 09:37:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Coding-Practices.com: Try-Catch Syntax Weirdness]]></title>
      <guid>http://www.phpdeveloper.org/news/8108</guid>
      <link>http://www.phpdeveloper.org/news/8108</link>
      <description><![CDATA[<p>
In working with his code recently, <i>Tim Koschuetzki</i> <a href="http://php-coding-practices.com/language-specific/try-catch-syntax-weirdness/">noticed something odd</a> with a block of try/catch code:
</p>
<blockquote>
I just noticed today, that PHP's try catch blocks require curly braces. Anybody has an idea why it is like that? I have used curly braces by default up until now, so I just stumbled upon this weirdness today.
</blockquote>
<p>
He includes two examples, one with a curly brace after the catch clause and the other without. This is different than several other control structures (like ifs) that don't require the curly brace when there's only the one line following it.
</p>]]></description>
      <pubDate>Fri, 22 Jun 2007 13:28:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alexander Netkachev's Blog: PHP coding tip: Convert notices and warnings into Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/6520</guid>
      <link>http://www.phpdeveloper.org/news/6520</link>
      <description><![CDATA[<p>
Exceptions and warnings can be tossed out from your code at some odd locations sometimes. There's a few options that you have when they jump out, including pushing them out to an error log or just ignoring them completely. <i>Alexander Netkachev</i> has a different solutions, though - handling them with something already built into PHP, <a href="http://www.alexatnet.com/Blog/Index/2006-10-18/php-coding-tip-convert-notices-and-warnings-into-exceptions">using exception reporting</a>.
</p>
<blockquote>
This coding tip demonstrates how to deal with PHP core notices and warning (aka recoverable errors) in the exception way, using try/catch statement.
</blockquote>
<p>
IT's a simple idea, but it can definitely help you keep all of you errors in one place. The sample code he gives shows both a basic idea of the solution and a bit more complex example, providing more detailed messages for different exception types.
</p>]]></description>
      <pubDate>Wed, 18 Oct 2006 07:19:54 -0500</pubDate>
    </item>
  </channel>
</rss>
