Doc #79271 [NEW]: DOMDocumentType extends DOMNode, but doesn't provide $childNodes as DOMNodeList
| From: | ca at lsp dot net | Date: | Thu, 13 Feb 2020 17:19:36 +0000 |
| Subject: | Doc #79271 [NEW]: DOMDocumentType extends DOMNode, but doesn't provide $childNodes as DOMNodeList | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-17297@lists.php.net to get a copy of this message | ||
From: ca at lsp dot net
Operating system: Windows
PHP version: 7.3.14
Package: DOM XML related
Bug Type: Documentation Problem
Bug description:DOMDocumentType extends DOMNode, but doesn't provide $childNodes as DOMNodeList
Description:
------------
---
From manual page: https://php.net/class.domdocumenttype
---
According to the
DOMNode documentation [1], the $childNodes property
always refers to a DOMNodeList.
However, DOMDocumentType extends DOMNode, but doesn't provide the
property nor supports hasChildNodes().
This means that the following test script causes a Notice.
[1] https://www.php.net/class.domnode.php
Test script:
---------------
$dom = new DOMImplementation();
$type = $dom->createDocumentType('html');
echo get_class($type->childNodes);
Expected result:
----------------
DOMNodeList
Actual result:
--------------
Warning: get_class() expects parameter 1 to be object, null given in
test.php on line 5
Call Stack:
0.0075 398976 1. {main}() test.php:0
--
Edit bug report at https://bugs.php.net/bug.php?id=79271&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79271&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79271&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79271&r=mysqlcfg