3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<foo />'; $doc = new DOMDocument(); $doc->loadXML($xml); $xpath = new DOMXPath($document); $xpath->registerNamespace('sig', 'http://www.w3.org/2000/09/xmldsig#'); $node = $xpath->query('//*[not(sig:SignatureValue)]'); $node->item(0)->nodeValue = 'sig';
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught TypeError: Argument 1 passed to DOMXPath::__construct() must be an instance of DOMDocument, null given in /in/JaGaD:7 Stack trace: #0 /in/JaGaD(7): DOMXPath->__construct(NULL) #1 {main} thrown in /in/JaGaD on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught exception 'Exception' with message 'DOMXPath::__construct expects parameter 1 to be DOMNode' in /in/JaGaD:7 Stack trace: #0 /in/JaGaD(7): DOMXPath->__construct() #1 {main}
Process exited with code 255.
Output for 5.2.6 - 5.6.28
Notice: Undefined variable: document in /in/JaGaD on line 7 Catchable fatal error: Argument 1 passed to DOMXPath::__construct() must be an instance of DOMDocument, null given in /in/JaGaD on line 7
Process exited with code 255.
Output for 5.0.5 - 5.2.5
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught exception 'DOMException' with message 'DOMXPath::__construct() expects parameter 1 to be DOMDocument, null given' in /in/JaGaD:7 Stack trace: #0 /in/JaGaD(7): DOMXPath->__construct(NULL) #1 {main} thrown in /in/JaGaD on line 7
Process exited with code 255.
Output for 5.0.4
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught exception 'DOMException' with message '__construct() expects parameter 1 to be DOMDocument, null given' in /in/JaGaD:7 Stack trace: #0 /in/JaGaD(7): DOMXPath->__construct(NULL) #1 {main} thrown in /in/JaGaD on line 7
Process exited with code 255.
Output for 5.0.3
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught exception 'DOMException' with message '__construct() expects parameter 1 to be DOMDocument, null given' in /in/JaGaD:7 Stack trace: #0 /in/JaGaD(7): DOMXPath->__construct(NULL) #1 {main} thrown in /in/JaGaD on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Undefined variable: document in /in/JaGaD on line 7 Fatal error: Uncaught exception 'DOMException' with message '__construct() expects parameter 1 to be DOMDocument, null given' in /in/JaGaD:7 Stack trace: #0 {main} thrown in /in/JaGaD on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/JaGaD on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/JaGaD on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/JaGaD on line 10
Process exited with code 255.