Edit report at http://bugs.php.net/bug.php?id=53511&edit=1
ID: 53511 Updated by: [email protected] Reported by: [email protected] 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] [email protected] 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] [email protected] 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
