Bug #61797 [Opn->Wfx]: DOMNode::appendChild doesn't increment refcount
| From: | beberlei@php.net | Date: | Sun, 22 Sep 2019 22:10:20 +0000 |
| Subject: | Bug #61797 [Opn->Wfx]: DOMNode::appendChild doesn't increment refcount | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222873@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61797&edit=1
ID: 61797
Updated by: beberlei@php.net
Reported by: kuba dot brecka at gmail dot com
Summary: DOMNode::appendChild doesn't increment refcount
-Status: Open
+Status: Wont fix
Type: Bug
Package: DOM XML related
Operating System: Windows, Linux
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
This is not a bug. DOMDocument guarantees you the return of a DOMElement from a childNode. If you
pass a subclass of DOMElement, then you must register is using "registerNodeClass". Not
doing so will only guarantee you a DOMElement, depending if original element fell out of scope.
Previous Comments:
------------------------------------------------------------------------
[2015-07-10 16:04:36] cmb@php.net
Related To: Bug #70026
------------------------------------------------------------------------
[2015-05-17 16:57:01] cmb@php.net
It appears to me that this is not a reference counting issue; at
least the additional zval_copy_ctor() leaks memory with a recent
master on Windows.
------------------------------------------------------------------------
[2013-12-03 07:45:44] krakjoe@php.net
The non-standard registerNodeClass exists to service the createElement functionality of the DOM,
there is no other logical reason for it's existence.
The patch doesn't change that, it enforces reference counting, which is required, everywhere.
------------------------------------------------------------------------
[2013-12-03 07:37:43] mike@php.net
Your patch reads like a bug fix, but reading it in context with the source it is not definitely a
bug. Why would you suggest registerNodeClass() exists?
If we change that, then obviously only for master.
But let's first try to reach an author for comment.
Rob?
------------------------------------------------------------------------
[2013-12-03 00:26:57] bjori@php.net
This is not a doc issue.. Reclassified as a bug.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61797
--
Edit this bug report at https://bugs.php.net/bug.php?id=61797&edit=1