Bug #79376 [NEW]: Clone is enforcing copy-on-write on some properties in large app

From: Date: Fri, 13 Mar 2020 00:30:07 +0000
Subject: Bug #79376 [NEW]: Clone is enforcing copy-on-write on some properties in large app
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226076@lists.php.net to get a copy of this message
From: michael dot vorisek at email dot cz Operating system: Linux PHP version: 7.4.3 Package: Scripting Engine problem Bug Type: Bug Bug description:Clone is enforcing copy-on-write on some properties in large app Description: ------------ After tens of hours I have isolated an issue where setting one property sets the same property of the same class of different instance (verified by objects hashes). I finally managed to fix the issue by the following code: public function __clone() { $elems = $this->elements; unset($this->elements); $this->elements = $elems; ... } I was not able to isolate this issue to short test code. Please confirm, that the following code is normally never needed if the "elements" property is an array and please check the source of PHP briefly for this issue. I have full access to the server so I can test anything. -- Edit bug report at https://bugs.php.net/bug.php?id=79376&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79376&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79376&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79376&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79376&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79376&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79376&r=support Expected behavior: https://bugs.php.net/fix.php?id=79376&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79376&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79376&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79376&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79376&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79376&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79376&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79376&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79376&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79376&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79376&r=mysqlcfg

« previous php.bugs (#226076) next »