3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lol() { $doc = new DOMDocument(); $comment = new DOMComment("asdf"); $doc->appendChild($comment); return $comment; } $a = lol(); $b = new DOMComment("meh"); $a->insertBefore($b); var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
object(DOMComment)#2 (20) { ["data"]=> string(4) "asdf" ["length"]=> int(4) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(8) "#comment" ["nodeValue"]=> string(4) "asdf" ["nodeType"]=> int(8) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> NULL ["lastChild"]=> NULL ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> NULL ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> NULL ["baseURI"]=> NULL ["textContent"]=> string(4) "asdf" }

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