From: georg at howen dot de
Operating system: Linux, Win XP
PHP version: 5.1.2
PHP Bug Type: DOM XML related
Bug description: DOMDocument::loadXML() within derived class broken
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
--
Edit bug report at http://bugs.php.net/?id=36600&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36600&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36600&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36600&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36600&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36600&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36600&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36600&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36600&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36600&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36600&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36600&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36600&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36600&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36600&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36600&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36600&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36600&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36600&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36600&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36600&r=mysqlcfg