<?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>Mon, 20 May 2013 00:06:35 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ole Markus' Blog: Catching fatal errors in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16031</guid>
      <link>http://www.phpdeveloper.org/news/16031</link>
      <description><![CDATA[<p>
<i>Ole Markus</i> has a new post today looking at how you can <a href="http://olemarkus.org/2011/03/catching-fatal-errors-in-php/">catch fatal errors</a> in your PHP applications a bit more gracefully than the usual failure messages.
</p>
<blockquote>
In dynamic languages like PHP [errors like E_ERROR and E_PARSE] happen all the time, for example when trying to call a method on a variable you assumed was an instance of a specific class, but which for some reason suddenly was not instantiated. Not only are they often not catched, but often it is also difficult to even know that they are occurring.
</blockquote>
<p>
His solution comes in the form of a built-in PHP function, <a href="http://php.net/register_shutdown_function">register_shutdown_function</a>, that executes when the PHP process is shutting down - errors or not. It takes in a callback method that has access to an exception object. You can get lots of interesting information from this object and, as in his example, log it to a file for future investigation.
</p>]]></description>
      <pubDate>Fri, 11 Mar 2011 09:16:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Eirik Hoem's Blog: Dying with grace - PHP's register_shutdown_function]]></title>
      <guid>http://www.phpdeveloper.org/news/9808</guid>
      <link>http://www.phpdeveloper.org/news/9808</link>
      <description><![CDATA[<p>
<i>Eirik Hoem</i> has <a href="http://eirikhoem.wordpress.com/2008/03/15/dying-with-grace-phps-register_shutdown_function/">posted a new look</a> at a function that can be amazingly helpful when you have a script with issues that needs a little extra help cleaning up after itself - <a href="http://no2.php.net/register_shutdown_function">register_shutdown_function</a>.
</p>
<blockquote>
Scripts tend to die, and that's not usually nice. We do not want to show the user a fatal error nor a blank page (display errors off) . PHP has a function called <a href="http://no2.php.net/register_shutdown_function">register_shutdown_function</a> which lets us set up a function which is called at execution shutdown. What this means is that our function will be executed when our script is done executing / dying and PHP execution is about to shut down.
</blockquote>
<p>
He <a href="http://eirikhoem.wordpress.com/2008/03/15/dying-with-grace-phps-register_shutdown_function/">suggests</a> various things that can be done with the functionality, including checking for successful script execution (via a false variable that can be checked for success).
</p>]]></description>
      <pubDate>Mon, 17 Mar 2008 12:02:00 -0500</pubDate>
    </item>
  </channel>
</rss>
