From: felix at fbreuer dot de Operating system: Windows PHP version: 4.3.10 PHP Bug Type: DOM XML related Bug description: insert_before($node,NULL) does not return
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. -- Edit bug report at http://bugs.php.net/?id=32340&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32340&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32340&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32340&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32340&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32340&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32340&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32340&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32340&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32340&r=support Expected behavior: http://bugs.php.net/fix.php?id=32340&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32340&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32340&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32340&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32340&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32340&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32340&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32340&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32340&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32340&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32340&r=mysqlcfg