|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-03 10:20 UTC] bjori@php.net
[2006-03-03 10:38 UTC] georg at howen dot de
[2006-03-03 11:42 UTC] georg at howen dot de
[2006-03-03 16:25 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 03:00:01 2025 UTC |
Description: ------------ If you extend DOMDocument and try to use DOMDocument::loadXML() on a new DOMDocument within the extended class, this function will return true instead of a new instance of DOMDocument. Reproduce code: --------------- <?php class xDOMDocument extends DOMDocument { public function newDom($xml) { $internal_doc1 = new DOMDocument; $internal_doc1->loadXML($xml); print_r($internal_doc1); $internal_doc2 = DOMDocument::loadXML($xml); print_r($internal_doc2); } } $xml = '<def>Test</def>'; $dom = new xDOMDocument(); $dom->newDom($xml); Expected result: ---------------- DOMDocument Object ( ) DOMDocument Object ( ) Actual result: -------------- DOMDocument Object ( ) 1