#28840 [NEW]: __destruct of a class that extends mysqli not called

From: Date: Sat, 19 Jun 2004 00:22:56 +0000
Subject: #28840 [NEW]: __destruct of a class that extends mysqli not called
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61089@lists.php.net to get a copy of this message
From: rodolfo at rodsoft dot org Operating system: linux 2.6.7 PHP version: 5.0.0RC3 PHP Bug Type: Zend Engine 2 problem Bug description: __destruct of a class that extends mysqli not called 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 bug report at http://bugs.php.net/?id=28840&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28840&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28840&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28840&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28840&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28840&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28840&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28840&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28840&r=support Expected behavior: http://bugs.php.net/fix.php?id=28840&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28840&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28840&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28840&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28840&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28840&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28840&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28840&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28840&r=float

« previous php.bugs (#61089) next »