#27425 [Ver]: Uncaught exception in try catch block
| From: | kase at gmx dot net | Date: | Tue, 02 Mar 2004 15:05:25 +0000 |
| Subject: | #27425 [Ver]: Uncaught exception in try catch block | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55782@lists.php.net to get a copy of this message | ||
ID: 27425
User updated by: kase at gmx dot net
Reported By: kase at gmx dot net
Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: linux
PHP Version: 5CVS-2004-02-27 (dev)
New Comment:
I tested this bug again, and i think, it is fixed in newest cvs, now.
Maybe related to these bugfixes:
1. http://news.php.net/article.php?group=php.internals&article=8268
2. http://news.php.net/article.php?group=php.internals&article=8280
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