News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

Stefan Priebsch's Blog:
Turning errors into exceptions
0 comments :: posted Wednesday April 30, 2008 @ 12:53:35
voice your opinion now!

In a recent blog entry Stefan Priebsch shows how to take an error thrown by your script and turn it into an exception (to make things like catchable fatal errors).

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.

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.

tagged with: error exception convert try catch fatal errorhandler


Justin's Blog:
Debugging Php
0 comments :: posted Thursday February 09, 2006 @ 07:22:32
voice your opinion now!
On his blog, Justin has posted an article from David Sklar today - a look at PHP error reporting - conifguration, locating errors, and checking variable values as the script runs.

Whether you're a PHP newbie or a wizard, your programs are going to have bugs in them. Nobody's perfect.

This article gives you some techniques for finding and fixing the problems in your programs. It covers three topics: how to get the PHP interpreter to report the errors that interest you, how to locate basic syntax errors in your program, How to check the values of variables as your program is running.

The configuration section mentions the display_errors and log_errors options to help debug your scripts. There's also a bit describing what the different error types mean (parse, fatal, strict) and simple things to look for to handle them. He also suggests some other resources to look at to help with more detailed error reporting...

tagged with: php debugging error reporting types common parse fatal notice php debugging error reporting types common parse fatal notice


code PEAR PHP5 zendframework mysql job package release application developer framework ajax security conference zend pecl database cakephp book releases

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework