Hi All,

I did some tests with the exception's under PHP5. I wanted to use the __autoload()-function to use for class loading. The function should throw an exception if it was not possible to load the class.
Code should be like that:
-----------------------------------------
try {
$x = new classname;
}
catch (Exception $exception) {
die('class not found');
}
-----------------------------------------
But I get an error, that the thrown exception is not cought...
Samplecode of __autoload():
-----------------------------------------
function __autoload($name)
{
throw new Exception();
}
-----------------------------------------
Is this an error of the PHP5-CVS-Version or is it impossible to catch exceptions thrown by the __autoload()-function?

David Danier

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to