#50446 [Bgs]: Missing documentation or bug for SET_EXCEPTION_HANDLER()

From: Date: Fri, 11 Dec 2009 19:41:00 +0000
Subject: #50446 [Bgs]: Missing documentation or bug for SET_EXCEPTION_HANDLER()
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3446@lists.php.net to get a copy of this message
ID: 50446 User updated by: randallgirard at hotmail dot com Reported By: randallgirard at hotmail dot com Status: Bogus Bug Type: Documentation problem Operating System: Windows PHP Version: 5.3.1 New Comment: What is the reason for this functionality, if you cannot return to processing of the script? Previous Comments: ------------------------------------------------------------------------ [2009-12-11 09:55:54] rquadling@php.net As does the Description ... "Execution will stop after the exception_handler is called." Nothing additional required. ------------------------------------------------------------------------ [2009-12-11 09:34:47] rquadling@php.net The example does show this, but some additional words may be useful. ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#3446) next »