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->name); print_r($attr);
Output for git.master, git.master_jit, rfc.property-hooks
string(1) "a" 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:
54.57 ms | 402 KiB | 8 Q