From:             kase at gmx dot net
Operating system: linux
PHP version:      5CVS-2004-02-27 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Uncaught exception in try catch block

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 bug report at http://bugs.php.net/?id=27425&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27425&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27425&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27425&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27425&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27425&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27425&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27425&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27425&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27425&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27425&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27425&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27425&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27425&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27425&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27425&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27425&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27425&r=float

Reply via email to