|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-17 09:43 UTC] sniper@php.net
[2005-03-17 14:14 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ When using insert_before($node,NULL) to insert a DOM element as the last child of some other element, insert_before never returns (and does not throw an error). This call will work, if $node is unlinked before. The documentation of insert_node, however, says that unlinking is not required. See example code below. Reproduce code: --------------- <?php $doc = domxml_open_mem("<foo><bar/></foo>"); $dom = domxml_open_mem("<outer><inner/></outer>"); $root = $doc->document_element(); $node = $dom->document_element(); //$node->unlink_node(); // uncomment this to work $root->insert_before($node,NULL); echo $doc->dump_mem(); ?> Expected result: ---------------- Ideally: <foo><bar/><outer><inner/></outer></foo> If it is desired that the user has to explicitly unlink the node before inserting it, it would be nice to have an error message. insert_before should not hang. Actual result: -------------- insert_before does not return. The page is never sent to the client. No error message is given.