note 73241 added to language.oop5.autoload
| From: | p dot scheit at zweipol dot net | Date: | Wed, 14 Feb 2007 12:49:49 +0000 |
| Subject: | note 73241 added to language.oop5.autoload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123369@lists.php.net to get a copy of this message | ||
If you really wan't to use something like Exceptions, but you don't want to use eval (like
me) I have a suggestion for you.
This is "oldschool" Try and Catching by checking the return value.
$cfgLine = $this->generateMapping($className,NULL,TRUE);
if ($cfgLine instanceof Exception) {
$e = $cfgLine;
trigger_error('uncaught exception: '.$e->getMessage().'
'.$e->getTraceAsString(), E_USER_ERROR);
}
you get the point...
This looks like a usual uncaught Exception.
It's a little bit tricky to check all return values from your Methods, but you can catch and
throw something ... better than doing nothing
----
Server IP: 217.160.72.57
Probable Submitter: 85.183.76.2
----
Manual Page -- http://www.php.net/manual/en/language.oop5.autoload.php
Edit -- https://master.php.net/note/edit/73241
Del: integrated -- https://master.php.net/note/delete/73241/integrated
Del: useless -- https://master.php.net/note/delete/73241/useless
Del: bad code -- https://master.php.net/note/delete/73241/bad+code
Del: spam -- https://master.php.net/note/delete/73241/spam
Del: non-english -- https://master.php.net/note/delete/73241/non-english
Del: in docs -- https://master.php.net/note/delete/73241/in+docs
Del: other reasons-- https://master.php.net/note/delete/73241
Reject -- https://master.php.net/note/reject/73241
Search -- https://master.php.net/manage/user-notes.php