Bug #53769 [Com]: Order to call __destruct on global way
| From: | melindaetinw81 at gmail dot com | Date: | Mon, 12 Dec 2022 06:16:52 +0000 |
| Subject: | Bug #53769 [Com]: Order to call __destruct on global way | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-243108@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53769&edit=1
ID: 53769
Comment by: melindaetinw81 at gmail dot com
Reported by: administrateur at exinsidephp dot com
Summary: Order to call __destruct on global way
Status: Open
Type: Bug
Package: Class/Object related
Operating System: All
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Iâm also having this exact issue. Did either of you have luck fixing it?
(https://www.expresshr.ltd/)github.com
Previous Comments:
------------------------------------------------------------------------
[2022-12-12 06:16:51] melindaetinw81 at gmail dot com
Iâm also having this exact issue. Did either of you have luck fixing it?
(https://www.expresshr.ltd/)github.com
------------------------------------------------------------------------
[2016-03-26 23:45:09] nikic@php.net
Related to bug #66023 and bug #71722.
------------------------------------------------------------------------
[2016-03-26 23:44:47] nikic@php.net
Related To: Bug #66023
------------------------------------------------------------------------
[2016-03-26 23:42:53] nikic@php.net
Related To: Bug #71722
------------------------------------------------------------------------
[2011-01-17 16:17:06] administrateur at exinsidephp dot com
Description:
------------
Hello,
In my opinion, the Garbage collector of PHP have a strange behavoir on order calling __destruct
methods. So the documentation say that GB call __destruct of an instance of object after all
references destroyed.
But this is not true if it have a reference on a static (global) scope. But for me a reference is
one that is in a global scope or not.
I think this is a bug, and if this is not, can you explain to me why GB have this behavior ?
Test script:
---------------
http://pastebin.com/pTb1fqQK
Expected result:
----------------
Show C Destruct C Show B Destruct B Destruct A
Actual result:
--------------
Show C Destruct C Destruct A Show B Destruct B
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53769&edit=1