@ 2014-06-06T22:51:19Z <?php
$xml = '<items><item/><item/><item/></items>';
$dom = new DOMDocument();
$dom->loadXml($xml);
var_dump(iterator_to_array($dom->documentElement->childNodes));
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.3.0 - 8.3.6 array(3) {
[0]=>
object(DOMElement)#5 (27) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["className"]=>
string(0) ""
["id"]=>
string(0) ""
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#6 (27) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["className"]=>
string(0) ""
["id"]=>
string(0) ""
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#7 (27) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["className"]=>
string(0) ""
["id"]=>
string(0) ""
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
NULL
["attributes"]=>
string(22) "(object value omitted)"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 array(3) {
[0]=>
object(DOMElement)#5 (23) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#6 (23) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#7 (23) {
["schemaTypeInfo"]=>
NULL
["tagName"]=>
string(4) "item"
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
NULL
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 8.0.0 - 8.0.30 array(3) {
[0]=>
object(DOMElement)#5 (23) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#6 (23) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
string(22) "(object value omitted)"
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#7 (23) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
string(22) "(object value omitted)"
["nextElementSibling"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
NULL
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 7.0.16 - 7.0.33 , 7.1.2 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 array(3) {
[0]=>
object(DOMElement)#5 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#6 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#7 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
NULL
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 7.0.0 - 7.0.15 , 7.1.0 - 7.1.1 array(3) {
[0]=>
object(DOMElement)#5 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#6 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#7 (17) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 5.3.11 - 5.3.29 , 5.4.1 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 array(3) {
[0]=>
object(DOMElement)#4 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
NULL
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[1]=>
object(DOMElement)#5 (18) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
[2]=>
object(DOMElement)#6 (17) {
["tagName"]=>
string(4) "item"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(4) "item"
["nodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(4) "item"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(0) ""
}
}
Output for 5.3.7 - 5.3.10 , 5.4.0 array(3) {
[0]=>
object(DOMElement)#4 (0) {
}
[1]=>
object(DOMElement)#5 (0) {
}
[2]=>
object(DOMElement)#6 (0) {
}
}
Output for 5.3.6 array(1) {
[16759200]=>
object(DOMElement)#4 (0) {
}
}
Output for 5.3.5 array(1) {
[21060000]=>
object(DOMElement)#4 (0) {
}
}
Output for 5.3.4 array(1) {
[35232160]=>
object(DOMElement)#4 (0) {
}
}
Output for 5.3.3 array(1) {
[45140384]=>
object(DOMElement)#4 (0) {
}
}
Output for 5.2.0 - 5.2.17 , 5.3.0 - 5.3.2 Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, instance of DOMNodeList given in /in/ROvaD on line 9
Process exited with code 255 . Output for 5.1.0 - 5.1.6 Warning: iterator_to_array() expects parameter 1 to be Traversable, object given in /in/ROvaD on line 9
bool(false)
Output for 5.0.0 - 5.0.5 Fatal error: Call to undefined function iterator_to_array() in /in/ROvaD on line 9
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.9 Fatal error: Cannot instantiate non-existent class: domdocument in /in/ROvaD on line 5
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Cannot instantiate non-existent class: domdocument in /in/ROvaD on line 5
preferences:dark mode live preview
271.28 ms | 401 KiB | 457 Q