Bug #60323 [Opn->Nab]: Extended DOMDocument will change to unextended DOMDocument on context change
| From: | mike@php.net | Date: | Tue, 03 Dec 2013 09:09:17 +0000 |
| Subject: | Bug #60323 [Opn->Nab]: Extended DOMDocument will change to unextended DOMDocument on context change | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183091@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60323&edit=1
ID: 60323
Updated by: mike@php.net
Reported by: gmblar+php at gmail dot com
Summary: Extended DOMDocument will change to unextended
DOMDocument on context change
-Status: Open
+Status: Not a bug
Type: Bug
Package: DOM XML related
Operating System: MacOSX
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
You have to register your subclass:
$document->registerNodeClass("DOMDocument", "Document");
Previous Comments:
------------------------------------------------------------------------
[2011-11-17 22:06:19] gmblar+php at gmail dot com
Description:
------------
Extended DOMDocument will change to unextended DOMDocument on context change
Test script:
---------------
<?php
class Document extends DOMDocument {
}
function foo() {
$document = new Document();
$element = $document->appendChild($document->createElement('div'));
var_dump($element->ownerDocument instanceOf Document);
return $element;
}
$element = foo();
var_dump($element->ownerDocument instanceOf Document);
Expected result:
----------------
bool(true)
bool(true)
Actual result:
--------------
bool(true)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60323&edit=1