3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dom = new DOMDocument(); $dom->registerNodeClass('DOMElement', 'MyElement'); $dom->appendChild($dom->createElement('Foo', 'Bar')); echo $dom->documentElement->UNKNOWN_PROPERTY = ':-)';
based on rLOLC
Output for 7.0.0 - 7.1.0
Warning: DOMDocument::registerNodeClass() expects parameter 2 to be a valid class name, 'MyElement' given in /in/gAWdv on line 4 :-)
Output for 5.2.0 - 5.6.28
Fatal error: DOMDocument::registerNodeClass(): Class MyElement does not exist in /in/gAWdv on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined method DOMDocument::registerNodeClass() in /in/gAWdv on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/gAWdv on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/gAWdv on line 3