3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $dom=new DOMDocument(); $dom->loadXML($xml); $val=$dom->getElementsByTagName('root')->item(0); print_r($val); var_dump($val-nodeValue);
Output for git.master, git.master_jit, rfc.property-hooks
DOMElement Object ( [schemaTypeInfo] => [tagName] => root [firstElementChild] => (object value omitted) [lastElementChild] => (object value omitted) [childElementCount] => 2 [previousElementSibling] => [nextElementSibling] => [nodeName] => root [nodeValue] => [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [nextSibling] => [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => root [baseURI] => / [textContent] => ) Fatal error: Uncaught Error: Undefined constant "nodeValue" in /in/DdJVG:17 Stack trace: #0 {main} thrown in /in/DdJVG on line 17
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.95 ms | 402 KiB | 8 Q