#36477 [NEW]: Exceptions break debug_backtrace()
| From: | ch at westend dot com | Date: | Tue, 21 Feb 2006 15:02:05 +0000 |
| Subject: | #36477 [NEW]: Exceptions break debug_backtrace() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-93481@lists.php.net to get a copy of this message | ||
From: ch at westend dot com
Operating system: Linux
PHP version: 5.1.2
PHP Bug Type: Scripting Engine problem
Bug description: Exceptions break debug_backtrace()
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]
--
Edit bug report at http://bugs.php.net/?id=36477&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36477&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36477&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36477&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36477&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36477&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36477&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36477&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36477&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36477&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36477&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36477&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36477&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36477&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36477&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36477&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36477&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36477&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36477&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36477&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36477&r=mysqlcfg