News Feed
Sections




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

DevShed:
Improving Exception Throwing when Auto Loading Classes in PHP 5
December 18, 2007 @ 12:56:00

DevShed continues their looks at autoloading classes in PHP5 today with this new tutorial focusing on catching and handling any errors that might be thrown in the process.

This is the third article in the series on how to auto load classes in PHP 5. This article will demonstrate how to trigger exceptions in a way that can be caught by the corresponding "catch()" block. [...] Nonetheless, this issue can be fixed with relative ease. That will be the goal of this third article of the series. So if you're interested in learning how this solution will be implemented, don't waste any more time and start reading now!

They start by looking at throwing an exception with the __autoload so that the script can catch it. The go back to mention the method they'd talked about before - using just eval() - and then show the "new and improved" method of handling the result with a try/catch block instead of a direct output.

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


blog comments powered by Disqus

Similar Posts

rooJSolutions Blog: Watch-out PHP 5.3.7+ is about.. and the is_a() / __autoload() mess.

Gonzalo Ayuso: Scaling Silex applications (part II). Using RouteCollection

Simon Jones' Blog: Admin sub-modules in Zend Framework

Sameer Borate's Blog: Parallel cURL execution in PHP

Constantin Bosneaga: Using layout pattern with CodeIgniter


Community Events





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


release introduction zendserver tips api bugfix symfony developer podcast interview library community deployment list voicesoftheelephpant laravel conference series language framework

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