News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Throwing Basic Exceptions When Auto Loading Classes in PHP 5
December 12, 2007 @ 07:55:00

DevShed has posted the second part of their series looking at handling exceptions in a PHP5 application today. This one focuses on capturing the errors thrown when your script autoloads classes.

Bearing in mind this intrinsic limitation exposed by the "__autoload()" magic function when it comes to triggering exceptions at runtime, in this second article of the series I'm going to show you some basic workarounds that you can implement to provide this function with the ability to throw exceptions when a determined source class fails to be included.

They give two examples of the use of the __autoload function as well as a method to capture the fatal errors that it might throw (using an eval inside of it to check on the class).

0 comments voice your opinion now!
php5 autoload throw exception class php5 autoload throw exception class


blog comments powered by Disqus

Similar Posts

Greg Beaver's Blog: PHP_ParserGenerator and PHP_LexerGenerator

PHP -GTK Community Site: A New Trio of Posts (phpISO, a PHP-GTK book, and Dev Inspector)

Henri Bergius' Blog: Next Midgard will be PHP5 only

SitePoint PHP Blog: J4P5 - Javascript For PHP5

DevShed: Handling Result Sets and More with PDO Objects in PHP 5


Community Events

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


voicesoftheelephpant laravel library opinion unittest conference language framework community release laravel5 interview introduction series api wordpress extension middleware development podcast

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