3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new DOMDocument(); //$xml->loadXML('<root><node/></root>'); $root = $xml->createElement("root"); $xml->appendChild($root); //$xpath = new DOMXpath($xml); $el = $xml->createElement("testnode", "some val"); $root->appendChild($el); $xml->formatOutput = true; echo $xml->saveXML(); //$entries = $xpath->query("/testnode");
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<?xml version="1.0"?> <root> <testnode>some val</testnode> </root>
Output for 5.1.0
<br /> <b>Fatal error</b>: fatal flex scanner internal error--end of buffer missed in <b>/in/oCvv4</b> on line <b>11</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: domdocument in <b>/in/oCvv4</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: domdocument in <b>/in/oCvv4</b> on line <b>2</b><br />