3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML('<example a="b">Test</example>'); $example = $doc->getElementsByTagName('example')->item(0); $attr = $example->getAttributeNode('a'); var_dump($attr); print_r($attr);
Output for git.master, git.master_jit, rfc.property-hooks
object(DOMAttr)#2 (21) { ["specified"]=> bool(true) ["schemaTypeInfo"]=> NULL ["name"]=> string(1) "a" ["value"]=> string(1) "b" ["ownerElement"]=> string(22) "(object value omitted)" ["nodeName"]=> string(1) "a" ["nodeValue"]=> string(1) "b" ["nodeType"]=> int(2) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> NULL ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "a" ["baseURI"]=> string(1) "/" ["textContent"]=> string(1) "b" } DOMAttr Object ( [specified] => 1 [schemaTypeInfo] => [name] => a [value] => b [ownerElement] => (object value omitted) [nodeName] => a [nodeValue] => b [nodeType] => 2 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [nextSibling] => [attributes] => [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => a [baseURI] => / [textContent] => b )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.25 ms | 404 KiB | 8 Q