|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53286 no way to create an instance of a subclass of DOMDocument with a dtd
Submitted: 2010-11-09 22:42 UTC Modified: -
Avg. Score:4.2 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:0 (0.0%)
From: mathroc at gmail dot com Assigned:
Status: Open Package: DOM XML related
PHP Version: 5.3.3 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-11-09 22:42 UTC] mathroc at gmail dot com
DOMImplementation might have a registerClass(string $baseclass, string $extendedclass) method similar to DOMDocument::registerNodeClass in order to create custom subclass of DOMDocument with DOMImplementation::createDocument

Test script:
$implementation = new DOMImplementation();
$dtd = $implementation->createDocumentType('html');

$implementation->registerClass('DOMDocument', 'My_DOMDocument');
$doc = $implementation->createDocument('', null, $dtd);

echo get_class($doc);

Expected result:
output :


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 14:01:23 2021 UTC