#33407 [Opn->Bgs]: Invalid exception stack traces

From: Date: Mon, 20 Jun 2005 14:06:03 +0000
Subject: #33407 [Opn->Bgs]: Invalid exception stack traces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80709@lists.php.net to get a copy of this message
ID: 33407 Updated by: sniper@php.net Reported By: tomas_matousek at hotmail dot com -Status: Open +Status: Bogus Bug Type: Zend Engine 2 problem Operating System: WinXP PHP Version: 5.0.4 New Comment: Don't keep on throwing it..it never get's there -> no bug Previous Comments: ------------------------------------------------------------------------ [2005-06-20 15:38:11] tomas_matousek at hotmail dot com 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 this bug report at http://bugs.php.net/?id=33407&edit=1

« previous php.bugs (#80709) next »