ID:               26193
 Updated by:       [EMAIL PROTECTED]
 Reported By:      acm at tweakers dot net
-Status:           Open
+Status:           Wont fix
 Bug Type:         Zend Engine 2 problem
-Operating System: Linux
+Operating System: *
 PHP Version:      5.0.0b2 (beta2)
 New Comment:

For internal reasons there is nothing else the executor can do, so
catching such an exception will leave the executot in an unstable
state. Hence there is no exception.

Only in case of class_exists() and exception would be possible. But i
don't think someone will find a good solution for that and goes
implementing it.


Previous Comments:
------------------------------------------------------------------------

[2003-11-10 17:17:43] acm at tweakers dot net

Description:
------------
When You try to implement some sort of class-loader, the
autoload-function is very usefull.
But as soon as you want the user-code to do something special when a
class isn't found, it'd be handy to throw out an exception, which the
user-code either can catch or ignore.

With the current beta2 that isn't possible as it seems.

Reproduce code:
---------------
<?
    function __autoload($class)
    {
        throw new Exception($class . " does not exist.");
    }

try
{
    $obj = new test(); // Where test is a non-existent class
}
catch(Exception $e)
{
    echo $e;
}
?>

Expected result:
----------------
Something like:
exception 'exception' with message 'test does not exist.' etc..

Actual result:
--------------
Fatal error: __autoload threw an exception in
/home/acm/public_html/kb/autoload.php on line 11


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26193&edit=1

Reply via email to