3v4l.org

run code in 300+ PHP versions simultaneously
<?php $root = new DOMDocument(); $root->loadXML('<foo/>'); $node = new DOMDocument(); $node->loadXML('<bar>baz</bar>'); var_dump($node->documentElement); $node = $root->importNode($node); $root->appendChild($node);
Output for git.master, git.master_jit
object(DOMElement)#3 (23) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(3) "bar" ["firstElementChild"]=> NULL ["lastElementChild"]=> NULL ["childElementCount"]=> int(0) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(3) "bar" ["nodeValue"]=> string(3) "baz" ["nodeType"]=> int(1) ["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"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(3) "bar" ["baseURI"]=> string(1) "/" ["textContent"]=> string(3) "baz" } Warning: DOMDocument::importNode(): Cannot import: Node Type Not Supported in /in/ScKfs on line 10 Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, bool given in /in/ScKfs:11 Stack trace: #0 /in/ScKfs(11): DOMNode->appendChild(false) #1 {main} thrown in /in/ScKfs on line 11
Process exited with code 255.
Output for rfc.property-hooks
object(DOMElement)#3 (23) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(3) "bar" ["firstElementChild"]=> NULL ["lastElementChild"]=> NULL ["childElementCount"]=> int(0) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(3) "bar" ["nodeValue"]=> string(3) "baz" ["nodeType"]=> int(1) ["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"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(3) "bar" ["baseURI"]=> string(1) "/" ["textContent"]=> string(3) "baz" } Warning: DOMDocument::importNode(): Cannot import: Node Type Not Supported in /in/ScKfs on line 10 Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, false given in /in/ScKfs:11 Stack trace: #0 /in/ScKfs(11): DOMNode->appendChild(false) #1 {main} thrown in /in/ScKfs on line 11
Process exited with code 255.

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:
48.3 ms | 402 KiB | 8 Q