Edit report at http://bugs.php.net/bug.php?id=53511&edit=1

 ID:                 53511
 Updated by:         dmi...@php.net
 Reported by:        dmi...@php.net
 Summary:            Exceptions are lost in case an exception is thrown
                     in catch operator
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   *
 PHP Version:        trunk-SVN-2010-12-09 (SVN)
-Assigned To:        
+Assigned To:        dmitry
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2010-12-09 16:40:01] dmi...@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

Reply via email to