3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument; $doc->loadXML('<key1>KeyValue</key1> <key2 value="key2value"/> <group1> <group1Key>Group1KeyValue</group1Key> </group1>'); $element = $doc->documentElement; echo $element->nodeName, ' / ', $element->tagName;
Output for 5.5.0 - 5.6.21, 7.0.0 - 7.1.0
Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 2 in /in/uQ15Z on line 7 Notice: Trying to get property of non-object in /in/uQ15Z on line 9 / Notice: Trying to get property of non-object in /in/uQ15Z on line 9
Output for hhvm-3.10.0 - 3.12.0
Warning: Extra content at the end of the document in Entity, line: 2 Notice: Cannot access property on non-object in /in/uQ15Z on line 9 / Notice: Cannot access property on non-object in /in/uQ15Z on line 9
Output for 5.2.3 - 5.4.45
Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 2 in /in/uQ15Z on line 7 /
Output for 5.1.3 - 5.2.2
<br /> <b>Warning</b>: DOMDocument::loadXML() [<a href='function.DOMDocument-loadXML'>function.DOMDocument-loadXML</a>]: Extra content at the end of the document in Entity, line: 2 in <b>/in/uQ15Z</b> on line <b>7</b><br /> /
Output for 5.0.0 - 5.1.2
<br /> <b>Warning</b>: DOMDocument::loadXML() [<a href='function.loadXML'>function.loadXML</a>]: Extra content at the end of the document in Entity, line: 2 in <b>/in/uQ15Z</b> on line <b>7</b><br /> /
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: domdocument in <b>/in/uQ15Z</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/uQ15Z</b> on line <b>2</b><br />