ID:               27425
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kase at gmx dot net
-Status:           Open
+Status:           Verified
 Bug Type:         Zend Engine 2 problem
 Operating System: linux
 PHP Version:      5CVS-2004-02-27 (dev)


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

[2004-02-27 13:02:56] kase at gmx dot net

Description:
------------
If you throw an exception in a function, which is called in a try/catch
block, after creating 2 objects of a class, which has a function or
method in __destruct(), the exception won´t be caught.



If you create the objects $v1 and $v2 of 2 different classes, and both
classes _have_ the function __destruct(), and the second class (of $v2)
have a function or method in __destruct(), the problem will exist, too.

Reproduce code:
---------------
<?php

class some_class {

    public function __destruct() {

         time(); // any function/method call will do

                 // language structures will not

    }

}



function test() {

    $v1 = new some_class();

    $v2 = new some_class();

    throw new Exception();

}



try {

    test();

} catch (Exception $e) { 

} 

?>

Expected result:
----------------
The exception should be caught

Actual result:
--------------
Fatal error: Uncaught exception 'exception' in
/var/www/legendz/web/test/test.php5:12 Stack trace: #0
/var/www/legendz/web/test/test.php5(16): test() #1 {main} thrown in
/var/www/legendz/web/test/test.php5 on line 12




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


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

Reply via email to