#33407 [NEW]: Invalid exception stack traces

From: Date: Mon, 20 Jun 2005 13:38:11 +0000
Subject: #33407 [NEW]: Invalid exception stack traces
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80707@lists.php.net to get a copy of this message
From: tomas_matousek at hotmail dot com Operating system: WinXP PHP version: 5.0.4 PHP Bug Type: Zend Engine 2 problem Bug description: Invalid exception stack traces Description: ------------ Exception stack trace is created by the new operator and not when the exception is thrown. Is that an intention or a bug? I think it is bug and that it was intended to trace throwing of the exception since the stack trace message contains "thrown in ..." and not "created in ...". Reproduce code: --------------- <? function f() { return new Exception("hello"); } try { $a = f(); throw $a; } catch(Exception $e) { throw $e; } Expected result: ---------------- Fatal error: Uncaught exception 'Exception' with message 'hello' in C:\Web\$PhpTests\z.php:14 Stack trace: #0 C:\Web\$PhpTests\z.php(14): #1 {main} thrown in C:\Web\$PhpTests\z.php on line 14 Actual result: -------------- Fatal error: Uncaught exception 'Exception' with message 'hello' in C:\Web\$PhpTests\z.php:4 Stack trace: #0 C:\Web\$PhpTests\z.php(4): f() #1 C:\Web\$PhpTests\z.php(9): f() #2 {main} thrown in C:\Web\$PhpTests\z.php on line 4 -- Edit bug report at http://bugs.php.net/?id=33407&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33407&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33407&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33407&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33407&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33407&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33407&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33407&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33407&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33407&r=support Expected behavior: http://bugs.php.net/fix.php?id=33407&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33407&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33407&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33407&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33407&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33407&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33407&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33407&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33407&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33407&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33407&r=mysqlcfg

« previous php.bugs (#80707) next »