From: [EMAIL PROTECTED]
Operating system: FreeBSD
PHP version: 5CVS-2006-04-29 (CVS)
PHP Bug Type: DOM XML related
Bug description: DOMNodeList returns wrong object
Description:
------------
DOMNodeList seems to be returning wrong objects.
Reproduce code:
---------------
<?php
class element extends DOMElement {
}
$doc = new DOMDocument;
$e = new element("e");
$doc->appendChild($e);
$e = new element("e");
$doc->appendChild($e);
$e = new element("e");
$doc->appendChild($e);
$nodeList = $doc->getElementsByTagName("e");
foreach($nodeList as $element) {
var_dump(get_class($element));
}
Expected result:
----------------
string(7) "element"
string(7) "element"
string(7) "element"
Actual result:
--------------
string(10) "DOMElement"
string(10) "DOMElement"
string(7) "element"
--
Edit bug report at http://bugs.php.net/?id=37248&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37248&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=37248&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37248&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37248&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37248&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37248&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37248&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37248&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37248&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37248&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37248&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37248&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37248&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37248&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37248&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37248&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37248&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37248&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37248&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37248&r=mysqlcfg