Bug #81126 [NEW]: Destructor is invoked even if invoked manually already

From: Date: Thu, 10 Jun 2021 19:51:55 +0000
Subject: Bug #81126 [NEW]: Destructor is invoked even if invoked manually already
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234361@lists.php.net to get a copy of this message
From: m at m dot cz Operating system: any PHP version: 8.0.7 Package: Scripting Engine problem Bug Type: Bug Bug description:Destructor is invoked even if invoked manually already Description: ------------ see https://3v4l.org/AjLjK Test script: --------------- <?php $a = new class { public function __destruct() { echo '__destruct called' . "\n"; } }; $a->__destruct(); $a = null; Expected result: ---------------- __destruct called and maybe some warning as __destruct should not be called manually Actual result: -------------- __destruct called __destruct called -- Edit bug report at https://bugs.php.net/bug.php?id=81126&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81126&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81126&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81126&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81126&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81126&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81126&r=support Expected behavior: https://bugs.php.net/fix.php?id=81126&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81126&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81126&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81126&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81126&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81126&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81126&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81126&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81126&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81126&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81126&r=mysqlcfg

« previous php.bugs (#234361) next »