coolgk Posted August 5, 2009 Share Posted August 5, 2009 Hi pro's If you run the script below, you will get a fatal error (PHP 5.2.4), but the script is supposed to stop at the time exception is thrown out (i.e. this error should not get fired?) if you uncomment class_exists('c2'), and run it, no error will happen (class_exists does not create an actually intance???). So how come uncaught exception does not stop the script, still let the error fired. Thanks heaps. function test($e){ echo $e->getMessage(); } set_exception_handler('test'); // class_exists('c2'); $x = new c2(); function __autoload($className){ echo "Autoload"; throw new Exception(' Failed'); } Link to comment https://forums.phpfreaks.com/topic/168885-lf-pro-exception-problem/ Share on other sites More sharing options...
trq Posted August 5, 2009 Share Posted August 5, 2009 From the manual.... When an exception is thrown, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an "Uncaught Exception ..." message, unless a handler has been defined with set_exception_handler(). Link to comment https://forums.phpfreaks.com/topic/168885-lf-pro-exception-problem/#findComment-891270 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.