#41696 [NEW]: Repeat calling to __destruct

From: Date: Fri, 15 Jun 2007 06:28:06 +0000
Subject: #41696 [NEW]: Repeat calling to __destruct
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113815@lists.php.net to get a copy of this message
From: irik at future-proof dot net Operating system: Linux (Slackware) 2.6.11.10 PHP version: 5.2.3 PHP Bug Type: Class/Object related Bug description: Repeat calling to __destruct Description: ------------ on linux (slackware) the __destruct method seems to be called twice, even before. On windows32 this behaviour is not seen. Perhaps I misunderstand the role of __destruct, but that would not explain why the behaviour differs between platforms. Reproduce code: --------------- $Test = new Test(); echo $Test->strtolower("foo bar") . "<br />"; class Test { public function __construct() { } public function __call($function, $arguments) { return call_user_func_array($function, $arguments); } public function __destruct() { echo "here i am<br />"; } } Expected result: ---------------- foo bar here i am Actual result: -------------- here i am foo bar here i am -- Edit bug report at http://bugs.php.net/?id=41696&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41696&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41696&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41696&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41696&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41696&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41696&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41696&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41696&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41696&r=support Expected behavior: http://bugs.php.net/fix.php?id=41696&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41696&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41696&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41696&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41696&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41696&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41696&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41696&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41696&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41696&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41696&r=mysqlcfg

« previous php.bugs (#113815) next »