3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument('1.0', 'utf8'); $doc->loadxml('<node><a>old content</a><a>2</a></node>'); $productRaw = $doc->getElementsByTagName('a'); print_r($productRaw[0]);
Output for 5.6.8 - 7.3.0rc3
DOMElement Object ( [tagName] => a [schemaTypeInfo] => [nodeName] => a [nodeValue] => old content [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [nextSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => a [baseURI] => / [textContent] => old content )
Output for 5.3.21 - 5.5.35
Fatal error: Cannot use object of type DOMNodeList as array in /in/0v8lu on line 8
Process exited with code 255.