#50446 [Opn]: Missing documentation or bug for SET_EXCEPTION_HANDLER()
| From: | rquadling@php.net | Date: | Fri, 11 Dec 2009 09:34:48 +0000 |
| Subject: | #50446 [Opn]: Missing documentation or bug for SET_EXCEPTION_HANDLER() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3442@lists.php.net to get a copy of this message | ||
ID: 50446
Updated by: rquadling@php.net
Reported By: randallgirard at hotmail dot com
Status: Open
Bug Type: Documentation problem
Operating System: Windows
PHP Version: 5.3.1
New Comment:
The example does show this, but some additional words may be useful.
Previous Comments:
------------------------------------------------------------------------
[2009-12-11 02:44:48] randallgirard at hotmail dot com
Description:
------------
The documentation does not state for the function
set_exception_handler(...) that it will terminate processing. I do not
see much of a reason for such a handler if you do not have this option.
Unless I am missing something, please include such documentation or fix
this in the next release. Take for example set_error_handler() which
forces you to handle termination of the script (when necessary) from
code.
NOTE: I am using v5.3.0 on my local machine for testing, and havent
tested on my server which runs 5.3.1 but I doubt this is the case.
Reproduce code:
---------------
function exception_handler($exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
}
set_exception_handler('exception_handler');
function errorone() {
throw new Exception("Test 1");
}
function errortwo() {
throw new Exception("Test 2");
}
function test() {
errorone();
errortwo();
}
test();
test();
# I also did further tests involving class scopes that I thought might
affect this, but I'm almost positive processing of the script is
terminated without a way to restore it.
Expected result:
----------------
Uncaught exception: Test 1\nUncaught exception: Test 2\nUncaught
exception: Test 1\nUncaught exception: Test 2\n
Actual result:
--------------
Uncaught exception: Test 1\n
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50446&edit=1