|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-06 15:35 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ Subclassing the classes provided by the DOMXML-Extension doesn't work. The usual approach building object-oriented applications is that the developer can subclass classes to save work and increase reliabilty of their applications. DOMXML doesn't seem to support that, see the reproduce code below. Of course, a developer could create a private property of the class TestElement and assign DomElement to this, but this is not the idea behind classes and objects and should be avoided (as this would also cause problems with multiple specialisation of classes, e.g. if TestElement would be specialized more); Reproduce code: --------------- Test case: <?php class TestElement extends DomElement { function TestElement { /* This doesn't work */ DomElement::DomElement("test"); /* This also doesn't work */ parent::DomElement("test"); } } ?> However, this works: <?php $element = new DomElement("test"); ?> Actual result: -------------- Warning: domelement(): Underlying object missing in <file>