Doc #80891 [Com]: DOMDocument::registerNodeClass contains wrong information

[email protected] ("kimia dot ssalamo9881 at gmail dot com") Fri, 23 Dec 2022 06:10:11 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=80891&edit=1

 ID:                 80891
 Comment by:         kimia dot ssalamo9881 at gmail dot com
 Reported by:        andrey at email dot dp dot ua
 Summary:            DOMDocument::registerNodeClass contains wrong
                     information
 Status:             Verified
 Type:               Documentation Problem
 Package:            DOM XML related
 Operating System:   Debian Linux
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for that. 

(https://www.pmppayslip.net/)github.com


Previous Comments:
------------------------------------------------------------------------
[2021-07-07 17:17:27] [email protected]

Right; but example #4 (Custom objects are transient) is still
correct, and needs to be considered by the developer.

------------------------------------------------------------------------
[2021-03-19 20:30:38] andrey at email dot dp dot ua

Description:
------------
DOMDocument::registerNodeClass manual contains the following chapter:

"Example #3 Retrieving owner document

When instantiating a custom DOMDocument the ownerDocument property will refer to the instantiated class, meaning there is no need (and in fact not possible) to use DOMDocument::registerNodeClass() with DOMDocument"

In fact this information is wrong. DOMDocument::registerNodeClass() with DOMDocument is required to set to work with extended DOMDocument classes

Otherwise extended DOMDocument class will be changed to unextended DOMDocument on context change

Please look at:
Bug #60323
Extended DOMDocument will change to unextended DOMDocument on context change



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80891&edit=1