Bug #81642 [Ver->Csd]: DOMChildNode::replaceWith() bug when replacing a node with itself.

From: Date: Sun, 04 Jun 2023 14:35:11 +0000
Subject: Bug #81642 [Ver->Csd]: DOMChildNode::replaceWith() bug when replacing a node with itself.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244599@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81642&edit=1 ID: 81642 Updated by: git@php.net Reported by: jules dot bernable at gmail dot com Summary: DOMChildNode::replaceWith() bug when replacing a node with itself. -Status: Verified +Status: Closed Type: Bug Package: DOM XML related Operating System: debian unstable PHP Version: 8.0.0 Assigned To: beberlei Block user comment: N Private report: N New Comment: Automatic comment on behalf of nielsdos Revision: https://github.com/php/php-src/commit/23f70025270c040e0d378b210120d9824af10ea6 Log: Fix bug #81642: DOMChildNode::replaceWith() bug when replacing a node with itself Previous Comments: ------------------------------------------------------------------------ [2023-01-13 06:09:14] LewisDickinson at rhyta dot com The childNodes property returns a NodeList containing the child nodes of the selected node If the selected node has no children, this property returns a NodeList containing no nodes. <https://www.novita-sphere.com/>github.com ------------------------------------------------------------------------ [2023-01-10 08:07:07] LouiseTalbot at rhyta dot com The childNodes property returns a NodeList containing the child nodes of the selected node If the selected node has no children, this property returns a NodeList containing no nodes. <https://www.thirtyonetoday.me/>github.com ------------------------------------------------------------------------ [2023-01-09 09:37:38] fosliffebernie at gmail dot com If you are trying to replace more than one node at once, you have to be careful about iterating over the DOMNodeList. If the old node has a different name from the new node, it will be removed from the list once it has been replaced. Use a regressive loop: $newelement = $xml>createTextNode('Some new node!'); <https://www.novitasphere.us/>github.com ------------------------------------------------------------------------ [2023-01-03 08:55:49] fosliffebernie at gmail dot com <https://www.mywafflehouse.us/>github.com ------------------------------------------------------------------------ [2022-12-24 04:48:50] OscarHutchinson at dayrep dot com English PHP documentation. Contribute to php/doc-en development by creating an account on GitHub. <https://www.hisdconnect.net/>github.com ------------------------------------------------------------------------ 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=81642 -- Edit this bug report at https://bugs.php.net/bug.php?id=81642&edit=1

« previous php.bugs (#244599) next »