|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-09 22:37 UTC] sailormax at inbox dot lv
[2011-01-16 22:24 UTC] stas@php.net
[2011-01-16 22:26 UTC] stas@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: stas
[2011-01-16 22:26 UTC] stas@php.net
[2011-05-17 07:55 UTC] paul at annesley dot cc
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 04:00:01 2025 UTC |
Description: ------------ In short, if you thrown an exception from within the exception handler, you get an uninformative error message with no contextual information. It makes sense for this case to be a fatal error. We don't want to get recursive throwing of exceptions and spiral to our death. If you create an exception in the error handler without throwing it, it has the correct info about where it was created. This is enough to figure out where the error is coming from. It is at least far more informative and gives you a starting place in a potentially complex code base. From my quick look at the code in Zend/zend_exceptions.c:94 where this originates. It looks like the exception is there, and that would have file/line num info. Test script: --------------- <?php set_exception_handler("exceptionHandler"); function exceptionHandler($excp) { throw new Exception("Error 2"); } throw new Exception("Error 1"); Expected result: ---------------- Fatal Error: Error 2 Actual result: -------------- Fatal error: Exception thrown without a stack frame in Unknown on line 0