PHP runkit and DOM insertAfter

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Any idea why PHP runkit does not allow you to extend a non-user-defined

In PHP runkit_methods.c it seems to do a check and calls
php_error_docref with E_WARNING ("class %s is not a user-defined
class") and returns FAILURE for the runkit function.

I'm trying to extend DOMNode/DOMElement and I cant just extend them
normally because DOMDocument wont return this new extended class in its
various functions and that's going to be a pain to deal with. Actually
thats another point - this is probably a DOM standard issue but why is
there no DOMNode::insertAfter() method?

Also how come DOMNode::insertBefore() needs a refnode instead of just
inserting before itself - that would seem insanely more logical to me
but then I am not the W3C and I don't have their infinite, dare I say
prophetic wisdom. If I have shown my ignorance to the DOM standard
please have mercy on me for I am nothing more than a minion and so
short-sighted that I am sure to miss their reasoning for making us jump
through hoops with $node->parentNode->insertBefore($new, $node); rather
than $node->insertBefore($new);

Site Timeline