#28840 [Fbk->Opn]: __destruct of a class that extends mysqli not called
| From: | helly@php.net | Date: | Sun, 06 Mar 2005 21:35:41 +0000 |
| Subject: | #28840 [Fbk->Opn]: __destruct of a class that extends mysqli not called | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74981@lists.php.net to get a copy of this message | ||
ID: 28840
Updated by: helly@php.net
Reported By: rodolfo at rodsoft dot org
-Status: Feedback
+Status: Open
Bug Type: Zend Engine 2 problem
-Operating System: linux 2.6.7
+Operating System: *
-PHP Version: 5.0.0RC3
+PHP Version: 5.0.3
-Assigned To:
+Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2005-03-06 20:30:00] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-02-13 10:15:01] ryan at wonko dot com
I'm experiencing this problem with a class that extends DOMDocument
using PHP 5.0.3 under both Windows XP and FreeBSD 5.3.
------------------------------------------------------------------------
[2004-12-01 23:54:16] tfraser at jeffsys dot net
As of 5.0.2, the same problem occurs.
------------------------------------------------------------------------
[2004-06-19 02:22:55] rodolfo at rodsoft dot org
Description:
------------
When you create a class by extending mysqli or mysqli_result and add a
destructor to it (to automatically call mysqli::close, for instance),
it doesn't get called when the object gets out of scope.
Reproduce code:
---------------
<?
class test extends mysqli
{
function __construct() { echo "born\n"; }
function __destruct() { echo "died\n"; }
}
$test = new test;
unset($test);
?>
Expected result:
----------------
born
died
Actual result:
--------------
born
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28840&edit=1