<?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, 25 May 2013 03:20:14 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: Round Table #1: Should Exceptions Ever be Used for Flow Control?]]></title>
      <guid>http://www.phpdeveloper.org/news/19376</guid>
      <link>http://www.phpdeveloper.org/news/19376</link>
      <description><![CDATA[<p>
On the NetTuts.com site today they've <a href="http://net.tutsplus.com/articles/general/round-table-1-should-exceptions-ever-be-used-for-flow-control/">posted the transcript</a> of a panel discussion they had with several developers about exceptions and whether or not they should be used for flow control.
</p>
<blockquote>
I'm pleased to release our first ever round table, where we place a group of developers in a locked room (not really), and ask them to debate one another on a single topic. In this first entry, we discuss exceptions and flow control.
</blockquote>
<p>
The opinions vary among the group as to what exceptions should be used for (even outside of the flow control topic). Opinions shared are things like:
</p>
<ul>
<li>Exceptions are situations in your code that you should never reach
<li>Errors cause Failures and are propagated, via Exceptions.
<li>So, essentially, exceptions are an "abstraction" purely to model the abnormality.
<li>Personally, I envision exceptions more as "objections." 
<li>Exceptions like this should be caught at some point and transformed into a friendly message to the user.
</ul>
<p>
There's lots more than this in <a href="http://net.tutsplus.com/articles/general/round-table-1-should-exceptions-ever-be-used-for-flow-control/">the full discussion</a> so head over and read it all - there's definitely some good points made.
</p>]]></description>
      <pubDate>Thu, 28 Mar 2013 10:20:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: Contributing To Zend Framework 2.0 Is Free! Hurry Before This Offer Ends!]]></title>
      <guid>http://www.phpdeveloper.org/news/15161</guid>
      <link>http://www.phpdeveloper.org/news/15161</link>
      <description><![CDATA[<p>
In <i>Padraic Brady</i>'s <a href="http://blog.astrumfutura.com/archives/433-Contributing-To-Zend-Framework-2.0-Is-Free!-Hurry-Before-This-Offer-Ends!.html">latest post</a> he makes a pitch for developers out there to get in on the development of the Zend Framework version 2.0 "before the offer ends" in a few different ways.
</p>
<blockquote>
Zend Framework 2.0 recently passed Milestone 1 on <a href="http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+2.0+Milestones">its development track</a> and is rocking on PHP 5.3 in all its namespaced glory. Milestone 2 is the introduction of <a href="http://framework.zend.com/wiki/display/ZFDEV2/Proposal+for+Exceptions+in+ZF2">the new Exception regime</a> to ensure all of the frameworks' fun components throw Exceptions that are specific enough to be useful. Why waste your idleness on the Devil's work when you can be bringing salvation to armies of PHP programmers?
</blockquote>
<p>
He links to some great resources if you want to get involved including <a href="http://framework.zend.com/wiki/display/ZFDEV2/Milestone+Exceptions">the list</a> of who's working on the exceptions handling, a link to the <a href="http://framework.zend.com/wiki/display/ZFDEV2/Component+Maintainers">components and maintainers list</a> for the framework and at <a href="http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+Git+Guide">getting started with Git</a> guide to introduce you to the version control you'll need to use.
</p>]]></description>
      <pubDate>Tue, 21 Sep 2010 09:54:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: The "do X or die()" pattern must die]]></title>
      <guid>http://www.phpdeveloper.org/news/14868</guid>
      <link>http://www.phpdeveloper.org/news/14868</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has a suggestion for all PHP developers out there - <a href="http://codeutopia.net/blog/2010/07/28/the-do-x-or-die-pattern-must-die/">stop using die()</a> for handling errors!
</p>
<blockquote>
What's the most common pattern for error handling you see in beginner's PHP code? - That's right, do_X() or die('do_X failed);. That's nice and all, as at least you have some sort of error handling, but I think this way of handling errors must go. There is no place for it in modern PHP code - it's the worst way to handle errors, not much better than not handling them at all.
</blockquote>
<p>
He talks about why <a href="http://php.net/die">die()</a> is so bad and some alternatives to it - <a href="http://php.net/trigger_error">trigger_error</a> (with a custom error handler) and <a href="http://php.net/Exceptions">exceptions</a>. When used correctly, these two can help your script correctly catch and handle errors without the mess of a die().
</p>]]></description>
      <pubDate>Thu, 29 Jul 2010 09:19:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tibo Beijen's Blog: Catching PHP Exceptions: Except the unexpected]]></title>
      <guid>http://www.phpdeveloper.org/news/13436</guid>
      <link>http://www.phpdeveloper.org/news/13436</link>
      <description><![CDATA[<p>
<i>Tibo Beijen</i> has <a href="http://www.tibobeijen.nl/blog/2009/10/26/catching-php-exceptions-except-the-unexpected/">a new post</a> to his blog today looking at exception handling starting with some of the basics and moving out to custom exception handing methods.
</p>
<blockquote>
Before PHP5 one had to resort to specific return values or drastic measures like trigger_error(). Planning exceptions, I found out, is just as important as class design. At any point where a developer needs to handle the possibility of an exception being thrown he needs to know: what Exceptions can I expect and what Exceptions do I plan to catch? In this post I'll show some important aspects to consider when planning exceptions.
</blockquote>
<p>
He starts off with a basic example of an exception, throwing it and catching it, as a part of a SOAP client sample and looks at things to catch, how to catch them and doing fun things like rethrowing and extending basic exception types.
</p>]]></description>
      <pubDate>Tue, 27 Oct 2009 10:21:43 -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>
    <item>
      <title><![CDATA[Developer.com: PHP 5 OOP - Delegation and Custom Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/5429</guid>
      <link>http://www.phpdeveloper.org/news/5429</link>
      <description><![CDATA[<p>
Developer.com has posted <a href="http://www.developer.com/lang/php/article.php/3608266">the next part</a> in their series covering object oriented programming in PHP5, this time focusing on using delegation to enhance the functionality of their prexisting DBQuery class.
</p>
<quote>
<i>
At present our DBQuery object simply mimics (all be it - rather simply) a stored procedure. Once executed a result resource is returned which you must store and pass the MySqlDB object if you wish to use functions such as num_rows() or fetch_row() on the result set. Would it not be nice if the DBQuery object were able to implement the functions which the MySqlDB object implements; that are designed to work on the result of an executed query?
</i>
</quote>
<p>
They <a href="http://www.developer.com/lang/php/article.php/3608266">explain each step</a> of the way, giving you the code you'll need to attach to the current working script, making this delegation possible. They look briefly at tpye hinting and simple exception handling in the script before hitting you with a full-blown Exception handler class to improve your script's reliability.
</p>]]></description>
      <pubDate>Tue, 23 May 2006 12:06:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: PHP to the Rescue!]]></title>
      <guid>http://www.phpdeveloper.org/news/5276</guid>
      <link>http://www.phpdeveloper.org/news/5276</link>
      <description><![CDATA[<p>
In his latest post on the SitePoint PHP Blog, <i>Harry Fuecks</i> <a href="http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/">has linked</a> to a rather long <a href="http://damienkatz.net/2006/04/error_code_vs_e.html">look at error codes and exceptions</a> in PHP, courtesy on <i>Damien Katz</i>.
</p>
<quote>
<i>
<p>
If you're looking for a thoughtful Saturday read, you won't go far wrong with <a href="http://damienkatz.net/2006/04/error_code_vs_e.html">Error codes or Exceptions? Why is Reliable Software so Hard?</a> by <a href="http://damienkatz.net/">Damien Katz</a>, which is worth it just for the visual interludes.
</p>
<p>
In fact it's less about error codes / exceptions and more about what you do when something does go wrong-how to you "bail out" of the mess you're in?
</p>
</i>
</quote>
<p>
There's a few different error handling types that <i>Damien</i> <a href="http://damienkatz.net/2006/04/error_code_vs_e.html">mentions</a>
</p>, including the "Get the Hell Out of Dodge" Error Handling, "Reverse the Flow of Time" Error Handling, and "Plan B" Error Handling as well as some suggestions to help you and your code cope.]]></description>
      <pubDate>Mon, 01 May 2006 07:34:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Error Handling in PHP - Introducing Exceptions in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/4690</guid>
      <link>http://www.phpdeveloper.org/news/4690</link>
      <description><![CDATA[Today, Devshed as posted the <a href="http://www.devshed.com/c/a/PHP/Error-Handling-in-PHP-Introducing-Exceptions-in-PHP-5/">second and last</a> part in their "Error Handling in PHP" series - Introducing Exceptions in PHP 5.
<p>
<quote>
<i>
Welcome to the last part of the series "Error Handling in PHP." In two parts, this series introduces the basics of error handling in PHP. It demonstrates some of the most common methods for manipulating errors in PHP 4, and explains the implementation of exceptions in PHP 5, particularly in object-oriented environments.
</i>
</quote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Error-Handling-in-PHP-Introducing-Exceptions-in-PHP-5/">introduce</a> things like try/catch blocks as well as more complex items like custom exceptions and exception subclassing. They start with the basics, but quickly move into grabbing more detailed error information, working with the various error types, and extending the Exception class with subclasses to make it more flexible...]]></description>
      <pubDate>Thu, 19 Jan 2006 06:53:22 -0600</pubDate>
    </item>
  </channel>
</rss>
