Bug #53511 [Asn->Csd]: Exceptions are lost in case an exception is thrown in catch operator
| From: | dmitry@php.net | Date: | Thu, 09 Dec 2010 16:38:52 +0000 |
| Subject: | Bug #53511 [Asn->Csd]: Exceptions are lost in case an exception is thrown in catch operator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156841@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53511&edit=1
ID: 53511
Updated by: dmitry@php.net
Reported by: dmitry@php.net
Summary: Exceptions are lost in case an exception is thrown
in catch operator
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: *
PHP Version: trunk-SVN-2010-12-09 (SVN)
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-12-09 17:38:39] dmitry@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=306135
Log: Fixed bug #53511 (Exceptions are lost in case an exception is
thrown in catch operator)
------------------------------------------------------------------------
[2010-12-09 16:40:01] dmitry@php.net
Description:
------------
In ZEND_CATCH instruction PHP assigns exception object to the given
variable and destroys its previous value, but this variable might keep
an object that throws an exception during destruction. As result PHP
loses both exceptions.
Test script:
---------------
<?php
class Foo {
function __destruct() {
throw new Exception("ops 1");
}
}
function test() {
$e = new Foo();
try {
throw new Exception("ops 2");
} catch (Exception $e) {
echo $e->getMessage()."\n";
}
}
test();
echo "bug\n";
Expected result:
----------------
information about exception(s)
Actual result:
--------------
bug
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53511&edit=1