3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dom = new DOMDocument(); $dom->loadXml('<foo xmlns=urn:foo/>'); var_dump($dom->documentElement->lookupNamespaceURI(NULL));
Output for 7.0.0 - 7.1.0
Warning: DOMDocument::loadXML(): AttValue: " or ' expected in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag foo line 1 in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /in/9965o on line 4 Fatal error: Uncaught Error: Call to a member function lookupNamespaceURI() on null in /in/9965o:6 Stack trace: #0 {main} thrown in /in/9965o on line 6
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: AttValue: " or ' expected in Entity, line: 1 Warning: attributes construct error in Entity, line: 1 Warning: Couldn't find end of Start Tag foo line 1 in Entity, line: 1 Warning: Extra content at the end of the document in Entity, line: 1 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function lookupNamespaceURI() on a non-object (null)' in /in/9965o:6 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: DOMDocument::loadXML(): AttValue: " or ' expected in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag foo line 1 in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /in/9965o on line 4 Fatal error: Call to a member function lookupNamespaceURI() on null in /in/9965o on line 6
Process exited with code 255.
Output for 5.0.0 - 5.5.35
Warning: DOMDocument::loadXML(): AttValue: " or ' expected in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag foo line 1 in Entity, line: 1 in /in/9965o on line 4 Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /in/9965o on line 4 Fatal error: Call to a member function lookupNamespaceURI() on a non-object in /in/9965o on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/9965o 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/9965o on line 3