ID:               40043
 Updated by:       [EMAIL PROTECTED]
 Reported By:      public at syranide dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP 32bit
 PHP Version:      5.2.0
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


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

[2007-01-06 13:48:38] public at syranide dot com

Although not fully on topic, it should be worth mentioning that it is
also slightly counter-intuitive that exceptions in shutdown functions
completely halts execution, preventing other shutdown functions from
executing.

Currently this is also avoidable by catching all exceptions in the
shutdown functions themselves, although this would be a nice feature as
well.

However I can agree that execution can turn pretty funny having caught
multiple exceptions, but personally I think it would benefit the
stability of shutdown functions.

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

[2007-01-06 13:33:54] public at syranide dot com

Description:
------------
Exceptions is a very nice addition to PHP5, however functions
registered with register_shutdown_function breaks this nice exception
model.

A function called during shutdown apparently does not have a stack, so
when an exception is thrown and is caught by the engine, instead of
forwarding the error to the registered exception handler a fatal error
is produced detailing nothing of the actual problem, only that the
there is no stack.

This is counter-intuitive as to the neat exception model, each function
must now internally catch all exceptions and output them.

Suggestion: forward the exception to the registered exception handler
(I can't see any problem in this as it is possible to catch the
exception yourself and pass it on to the exception handler).

Reproduce code:
---------------
register_shutdown_function('nostack');
function nostack() {
        throw new Exception();
}

Expected result:
----------------
Fatal error:  Uncaught exception 'Exception' in C:\php\test.php:4
Stack trace:
#0 C:\php\test.php(2): nostack()
#1 {main} thrown in C:\php\test.php on line 4

Actual result:
--------------
Fatal error:  Exception thrown without a stack frame in Unknown on line
0


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


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

Reply via email to