Doc #53890 [Opn->Bgs]: DOMDocumentFragment and AppendChild

From: Date: Thu, 10 Feb 2011 12:09:27 +0000
Subject: Doc #53890 [Opn->Bgs]: DOMDocumentFragment and AppendChild
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5944@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53890&edit=1 ID: 53890 Updated by: vrana@php.net Reported by: giosh94mhz at gmail dot com Summary: DOMDocumentFragment and AppendChild -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Works as expected. The appendChild() method actually moves the node if it is already somewhere else. Previous Comments: ------------------------------------------------------------------------ [2011-01-31 12:21:49] giosh94mhz at gmail dot com Description: ------------ --- From manual page: http://www.php.net/class.domdocumentfragment --- Undocumented behaviour for appendChild using a DOMDocumentFragment Test script: --------------- $doc=new DOMDocument(); $frag=$doc->createDocumentFragment(); $root=$doc->appendChild( $doc->createElement('root') ); $frag->appendChild( $doc->createElement('fragNode') ); echo $frag->childNodes->length; $root->appendChild($frag); echo $frag->childNodes->length; Expected result: ---------------- Documented behaviour. Actual result: -------------- 1 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53890&edit=1

« previous php.doc.bugs (#5944) next »