|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-05-11 12:06 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2020-05-11 12:06 UTC] nikic@php.net
[2020-05-11 13:08 UTC] michael dot vorisek at email dot cz
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
Description: ------------ Destructor has to be called on every attempt to release the object. Test script: --------------- class Registry { public static $v; } $v = new class() extends \stdClass { public function __destruct() { var_dump($this); Registry::$v = $this; echo 'destroyed' . "\n"; } }; unset($v); var_dump(Registry::$v); Registry::$v = null; // unset 2nd time Expected result: ---------------- object(class@anonymous)#17 (0) { } destroyed object(class@anonymous)#17 (0) { } object(class@anonymous)#17 (0) { } destroyed Actual result: -------------- object(class@anonymous)#17 (0) { } destroyed object(class@anonymous)#17 (0) { }