3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument; $foo = $doc->appendChild($doc->createElement('foo')); $bar = $foo->appendChild($doc->createElement('bar')); $bar->appendChild($doc->createTextNode('baz')); $bar = $foo->appendChild($doc->createElement('bar')); $bar->appendChild($doc->createTextNode('baz')); echo $doc->saveXML() . "\n"; echo $foo->C14N(false, false, array('query' => '//*'));
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<?xml version="1.0"?> <foo><bar>baz</bar><bar>baz</bar></foo> <foo><bar></bar><bar></bar></foo>
Output for 5.0.0 - 5.1.6
<?xml version="1.0"?> <foo><bar>baz</bar><bar>baz</bar></foo> Fatal error: Call to undefined method DOMElement::C14N() in /in/CI3sB on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/CI3sB 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/CI3sB on line 3