<?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, 19 Jun 2013 05:46:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Miro Svrtan: PHP Fatal errors into exceptions natively]]></title>
      <guid>http://www.phpdeveloper.org/news/18412</guid>
      <link>http://www.phpdeveloper.org/news/18412</link>
      <description><![CDATA[<p>
<i>Miro Svrtan</i> has <a href="http://www.mirosvrtan.me/blog/2012/08/php-fatal-errors-into-exceptions-natively/">a new post</a> today proposing something that could be added to help handle bad method calls in PHP apps - using the <a href="http://php.net/manual/en/class.badmethodcallexception.php">BadMethodCallException</a> (pre-existing) instead of throwing fatal errors.
</p>
<blockquote>
Using getter method that is not implemented will get you fatal error saying how undefined method is called and request will stop. [...] On the other hand if you would use public property all you would get is a notice saying how this property does not exist and rest of request would be completed. [...] I know that this is due to dynamic typing behavior of PHP and no I am not suggesting raising a notice if undefined method gets called but since 5.1.0 there is a BadMethodCallException class which would be perfect for this situation.
</blockquote>
<p>
There's been other people that have proposed the same idea as a bug, but nothing formal has been <a href="https://wiki.php.net/rfc">submitted as an RFC</a> to make the change. <i>Miro</i> is looking for feedback to find if others would be interested in this feature and want to make the proposal (<a href="http://www.mirosvrtan.me/blog/2012/08/php-fatal-errors-into-exceptions-natively/">leave comments here</a>).
</p>]]></description>
      <pubDate>Tue, 28 Aug 2012 10:08:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Invalid Protected Resource URL in pecl_oauth]]></title>
      <guid>http://www.phpdeveloper.org/news/16180</guid>
      <link>http://www.phpdeveloper.org/news/16180</link>
      <description><![CDATA[<p>
In a quick post to her blog today, <i>Lorna Mitchell</i> talks about <a href="http://www.lornajane.net/posts/2011/Invalid-Protected-Resource-URL-in-Pecl_Oauth">an issue with pecl_outh</a> tat came up during her development of a new API. A strange fatal error message was breaking her connection.
</p>
<blockquote>
I'd gone through all the handshaking steps, got the acces token and was ready to start talking to the service itself. However when I tried to call OAuth::fetch, I got an error message: Fatal error: Uncaught exception 'OAuthException' with message 'Invalid protected resource url, unable to generate signature base string'
</blockquote>
<p>
As it turns out, the issue was obscure - the address she was connecting to was missing a training slash (http://api.localhost versus http://api.localhost/) and it was causing the OAuth fetch to fail (apparently undocumented). If you're interested in some of the other things that have come up in her work with OAuth on the project, <a href="http://www.lornajane.net/plugin/tag/oauth">see here</a>.
</p>]]></description>
      <pubDate>Tue, 12 Apr 2011 10:16:03 -0500</pubDate>
    </item>
    <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[Douglas Brown's Blog: Quick Methods Used for Solving PHP Errors]]></title>
      <guid>http://www.phpdeveloper.org/news/11637</guid>
      <link>http://www.phpdeveloper.org/news/11637</link>
      <description><![CDATA[<p>
<i>Douglas Brown</i> has <a href="http://www.brownphp.com/2008/12/quick-methods-used-for-solving-php-errors/">posted some hints</a> to help you find errors in your PHP scripts all centered around error reporting settings.
</p>
<blockquote>
There are several methods to solve errors in PHP code. Sometimes when the user waits to see an output a blank page will be shown if there is an error. To show the errors E_ALL^E_STRICT is used for the PHP 5 version. Contrarily, remaining versions just use E_ALL.
</blockquote>
<p>
He talks about the log_errors and display_errors settings in your php.ini, the <a href="http://php.net/error_reporting">error_reporting</a> function call or a custom error handler as shown <a href="http://us2.php.net/manual/en/function.error-reporting.php#73759">in this example</a> from the PHP manual.
</p>]]></description>
      <pubDate>Tue, 30 Dec 2008 07:57:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPFreaks.com: Debugging: A Beginner's guide]]></title>
      <guid>http://www.phpdeveloper.org/news/10374</guid>
      <link>http://www.phpdeveloper.org/news/10374</link>
      <description><![CDATA[<p>
On PHPFreaks.com there's a <a href="http://www.phpfreaks.com/tutorial/debugging-a-beginners-guide">new tutorial</a> providing a beginner's guide to debugging in PHP (with the built in functionality PHP has, not external software).
</p>
<blockquote>
Everyday the forums see probably hundreds of topics posted where the problem is a fairly simple error. [...] As a beginner, it can be difficult to find and solve these errors. By tackling each of these in turn, I hope to teach you some methods of finding and solving them.
</blockquote>
<p>
They look at the different sorts of errors - syntax errors, fatal errors, warnings, notices - as well as some of the ones a bit harder to track down like database problems and logical errors.
</p>]]></description>
      <pubDate>Tue, 10 Jun 2008 07:59:13 -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[Northclick Blog: Getting the PHP fatal errors]]></title>
      <guid>http://www.phpdeveloper.org/news/7843</guid>
      <link>http://www.phpdeveloper.org/news/7843</link>
      <description><![CDATA[<p>
From the Nothclick dev blog, there's <a href="http://blog.northclick.de/archives/17">this new post</a> from <i> Soenke Ruempler</i> that talks about working with error messages in PHP, specifically with fatal errors.
</p>
<blockquote>
One big issue of the PHP error handling is that there's no built-in way to catch fatal errors with an user-defined error handler. So I thought a little bit about it and maybe you have better approaches or solutions...
</blockquote>
<p>
With the goal of emailing the developers when such an error is thrown, he comes up with three different "storage methods" - using syslog, sapi, or a common logfile - and two different methods for watching them - file watching and syslogger. He works through these two options, trying to figure out which out be the simplest to implement.
</p>
<p>
He comes to the conclusion, though, that he might just be better off with one of the packages already out there to do something similar. Of the four he found, <a href="http://sourceforge.net/projects/swatch/">Swatch</a> seemed to fit the best. He includes configuration and setup info to illustrate.
</p>]]></description>
      <pubDate>Tue, 15 May 2007 07:49:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Overloaded properties (__get)]]></title>
      <guid>http://www.phpdeveloper.org/news/6727</guid>
      <link>http://www.phpdeveloper.org/news/6727</link>
      <description><![CDATA[<p>
While testing the <a href="http://components.ez.no/">eZ components</a> framework on the latest version of PHP (PHP 5.2), <i>Derick Rethans</i> <a href="http://derickrethans.nl/overloaded_properties_get.php">noticed a problem</a> - a new "Notice" message appearing related to a __get call.
</p>
<blockquote>
The first issue is an extra notice in some cases. This all works 'fine' with PHP 5.1, however with PHP 5.2 the [following] notice was generated for this code.
</blockquote>
<p>
The cause? Well, the magic function __get only returns the variables in read mode so they cannot be written to. In <i>Derick</i>'s situation, there was a foreach that was trying to use the values in a read/write mode. As a result, the error was tossed. He does provide a workaround, though, involving casting the information into an array.
</p>]]></description>
      <pubDate>Fri, 17 Nov 2006 08:43:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: Its like everybody sees the wall coming...]]></title>
      <guid>http://www.phpdeveloper.org/news/6540</guid>
      <link>http://www.phpdeveloper.org/news/6540</link>
      <description><![CDATA[<p>
Despite the release candidates for PHP 5.2.0 marching on, <i>Lukas Smith</i> still has some misgivings about some of the functionality being introduced in the release - specifically about the fatal errors that are going to break a lot of (working) object oriented functionality.
</p>
<blockquote>
Anyways I just <a href="http://marc.theaimsgroup.com/?l=php-dev&m=116129321214749&w=2">posted</a> the following email to internals in a list attempt to get some of the people with php-dev karma to lift their finger.
</blockquote>
<p>
In the message, he notes <a href="http://marc.theaimsgroup.com/?l=php-dev&m=114734977430980&w=2">the change</a> he's looking for and a suggestion to get it included before RC6 of the series gets released (which has <a href="http://www.phpdeveloper.org/news/6539">been released</a> as of this post already).
</p>]]></description>
      <pubDate>Fri, 20 Oct 2006 07:38:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ilia Alshanetsky's Blog: Another unserialize() abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/5032</guid>
      <link>http://www.phpdeveloper.org/news/5032</link>
      <description><![CDATA[With yet another reason not to trust the users of your application (mainly the data they send you), <i>Ilia Alshanetsky</i> has <a href="http://ilia.ws/archives/107-Another-unserialize-abuse.html">details on an issue</a> that could be caused by the unserialize() function in PHP.
<p>
<quote>
<i>
While talking with PHP developers this morning I thought of another way unverified serialized strings could be abused. This exploit can only affect PHP 5 installs though, but given the growing market share of PHP 5 it is certainly something worth noting.
<p>
As you may know classes in PHP are allowed to implement a magic method called __wakeup() that contains operation that are to be performed when a class is deserialized. Some native classes like PDO implement this function with a goal of preventing database serialization and throw an error when it is used.
</i>
</quote>
<p>
He <a href="http://ilia.ws/archives/107-Another-unserialize-abuse.html">uses an example with PDO</a> and a string of a serialized "supposed PDO object" to illustrate how, without the proper handling, it could lead to a fatal error in the script. The end result of the fatal error, if displaying errors is still on, could be that somewhat sensitive information could be displayed to the viewer.]]></description>
      <pubDate>Thu, 23 Mar 2006 06:59:23 -0600</pubDate>
    </item>
  </channel>
</rss>
