|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-02 10:05 UTC] kase at gmx dot net
[2004-03-02 10:12 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
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