3v4l.org

run code in 200+ 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 7.2.0 - 7.2.6
Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 2 in /in/uQ15Z on line 3 Notice: Trying to get property 'nodeName' of non-object in /in/uQ15Z on line 9 / Notice: Trying to get property 'tagName' of non-object in /in/uQ15Z on line 9
Output for 7.0.20, 7.1.5 - 7.1.20
Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 2 in /in/uQ15Z on line 3 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 5.5.0 - 7.0.14, 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 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 />