|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-03-03 11:57 UTC] dmitry@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Thu Oct 30 23:00:01 2025 UTC | 
Description: ------------ After calling "throw new Exception(..)" and entering the function registered with "set_exception_handler()" the debug_backtrace() output is empty. This is very inconvinient for self written error handling functions as "trigger_error()" for example works fine for debug_backtrace. I'm aware that the exception itself contains a stack trace but is there really a reason to empty debug_backtrace()? Reproduce code: --------------- <?php function exception_handler($e) { debug_print_backtrace(); } function c() { throw new Exception("Problem!"); } function b() { c(); } function a() { b(); } set_exception_handler('exception_handler'); a(); ?> Expected result: ---------------- Backtrace with #1 exception_handler from c() #2 c() from b() #3 b() from a() #4 a() from main Actual result: -------------- #0 exception_handler(Exception Object ([] => Problem!,[] => ,[] => 0,[] => /home/ch/tt.php,[] => 5,[] => Array ([0] => Array ([file] => /home/ch/tt.php,[line] => 6,[function] => c,[args] => Array ()),[1] => Array ([file] => /home/ch/tt.php,[line] => 7,[function] => b,[args] => Array ()),[2] => Array ([file] => /home/ch/tt.php,[line] => 10,[function] => a,[args] => Array ())))) called at [(null):0]