|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-11-17 22:06 UTC] 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 06:00:01 2025 UTC |
You have to register your subclass: $document->registerNodeClass("DOMDocument", "Document");