|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33589 Subclassing DOMXML-Classes don't work
Submitted: 2005-07-06 14:48 UTC Modified: 2005-07-06 15:35 UTC
From: timo dot hummel at 4fb dot de Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.11 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
45 + 41 = ?
Subscribe to this entry?

 [2005-07-06 14:48 UTC] timo dot hummel at 4fb dot de
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:


class TestElement extends DomElement
  function TestElement
    /* This doesn't work */

    /* This also doesn't work */


However, this works:


$element = new DomElement("test");


Actual result:
Warning: domelement(): Underlying object missing in <file>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-06 15:35 UTC]
indeed, does not work in PHP 4.x. Never did, never will. Use 
PHP 5, where you can do that (with some reservation, but does 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Mar 04 14:01:24 2021 UTC