3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sxe = new SimpleXMLElement('<people xmlns:p="http://example.org/ns" xmlns:t="http://example.org/test"/>'); $xpath = new DOMXPath(($doc = dom_import_simplexml($sxe)->ownerDocument)); foreach($xpath->evaluate('/*/namespace::*') as $result) print_r($result);
based on b8M6B
Output for 5.3.11 - 5.3.29, 5.4.1 - 7.1.0
DOMNameSpaceNode Object ( [nodeName] => xmlns:xml [nodeValue] => http://www.w3.org/XML/1998/namespace [nodeType] => 18 [prefix] => xml [localName] => xml [namespaceURI] => http://www.w3.org/XML/1998/namespace [ownerDocument] => (object value omitted) [parentNode] => (object value omitted) ) DOMNameSpaceNode Object ( [nodeName] => xmlns:t [nodeValue] => http://example.org/test [nodeType] => 18 [prefix] => t [localName] => t [namespaceURI] => http://example.org/test [ownerDocument] => (object value omitted) [parentNode] => (object value omitted) ) DOMNameSpaceNode Object ( [nodeName] => xmlns:p [nodeValue] => http://example.org/ns [nodeType] => 18 [prefix] => p [localName] => p [namespaceURI] => http://example.org/ns [ownerDocument] => (object value omitted) [parentNode] => (object value omitted) )
Output for 5.1.0 - 5.3.10, 5.4.0
DOMNameSpaceNode Object ( ) DOMNameSpaceNode Object ( ) DOMNameSpaceNode Object ( )
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined method DOMXPath::evaluate() in /in/iecUQ on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/iecUQ on line 3
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/iecUQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iecUQ on line 3
Process exited with code 255.