|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-11 11:27 UTC] sniper@php.net
[2006-04-11 11:54 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 06:00:01 2025 UTC |
Description: ------------ Throwing an exception from inside a catch block within an exception handler function causes a fatal error. If I comment out the marked line, the fatal error does not occur. I would expect PHP to re-call the master exception handler function. Reproduce code: --------------- class TestException extends Exception { } set_exception_handler('handler'); function handler($ex) { /* Just to rule out recursion */ if ($ex instanceof TestException) { die("Recursion"); } try { /* This is where I would attempt to write to the db */ throw new Exception("someDBFunction failed"); } catch (Exception $ex) { /* If I comment out the following line, the error goes away */ throw new TestException("The db logging function failed..write to file."); } } throw new Exception("Ex"); Expected result: ---------------- The script should die with the message "Recursion" Actual result: -------------- Fatal error: Exception thrown without a stack frame in Unknown on line 0