ID:               33407
 User updated by:  tomas_matousek at hotmail dot com
 Reported By:      tomas_matousek at hotmail dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: WinXP
 PHP Version:      5.0.4
 New Comment:

I don't understand your comment. If you comment out the "throw $a;"
statement the exception is not thrown. So the "new" expression doesn't
throw it. However, if the exception is thrown by throw $a; why the
stack trace is generated during the construction. That's definitely a
bug.


Previous Comments:
------------------------------------------------------------------------

[2005-06-20 16:06:02] [EMAIL PROTECTED]

Don't keep on throwing it..it never get's there -> no bug


------------------------------------------------------------------------

[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

Reply via email to