News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Alexander Netkachev's Blog:
PHP coding tip Convert notices and warnings into Exceptions
October 18, 2006 @ 07:19:54

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. Alexander Netkachev has a different solutions, though - handling them with something already built into PHP, using exception reporting.

This coding tip demonstrates how to deal with PHP core notices and warning (aka recoverable errors) in the exception way, using try/catch statement.

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.

0 comments voice your opinion now!
warnings notices exceptions convert handling try catch warnings notices exceptions convert handling try catch



Similar Posts

Martynas Jusevicius' Blog: PHP 5 Features: Exceptions

Alexander Netkachev's Blog: PHP coding tip: Convert notices and warnings into Exceptions

SitePoint PHP Blog: PHP to the Rescue!

Dallas PHP User\'s Group: PHP5 Exception Handling (presentation)

DevShed: Error Handling in PHP - Introducing Exceptions in PHP 5


Community Events







Don't see your event here?
Let us know!


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

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