3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <DataSet> <xs:schema id="OutDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="OutDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="BuscaSMS"> <xs:complexType> <xs:sequence> <xs:element name="seunum" type="xs:string" minOccurs="0" /> <xs:element name="celular" type="xs:string" minOccurs="0" /> <xs:element name="mensagem" type="xs:string" minOccurs="0" /> <xs:element name="status" type="xs:string" minOccurs="0" /> <xs:element name="datarec" type="xs:dateTime" minOccurs="0" /> <xs:element name="dataenv" type="xs:dateTime" minOccurs="0" /> <xs:element name="datastatus" type="xs:dateTime" minOccurs="0" /> <xs:element name="op" type="xs:short" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <OutDataSet xmlns=""> <BuscaSMS diffgr:id="BuscaSMS0" msdata:rowOrder="3"> <seunum>999999999</seunum> <celular>9999999999</celular> <mensagem>obrigado</mensagem> <status>MO</status> <datarec>2018-02-01T13:30:51.547-02:00</datarec> <dataenv>2018-02-01T13:30:52.773-02:00</dataenv> <datastatus>2018-02-01T13:30:52.773-02:00</datastatus> <op>5</op> </BuscaSMS> <BuscaSMS diffgr:id="BuscaSMS1" msdata:rowOrder="4"> <seunum>99999999999</seunum> <celular>9999999999</celular> <mensagem>Obrigado.</mensagem> <status>MO</status> <datarec>2018-02-01T13:37:17.18-02:00</datarec> <dataenv>2018-02-01T13:37:20.807-02:00</dataenv> <datastatus>2018-02-01T13:37:20.807-02:00</datastatus> <op>5</op> </BuscaSMS> </OutDataSet> </diffgr:diffgram> </DataSet> XML; $dom = new \DOMDocument(); $dom->loadXML($xml); foreach($dom->getElementsByTagName('BuscaSMS') as $buscaSMS) { var_dump($buscaSMS); }
Output for 8.4.1
object(DOMElement)#4 (27) { ["tagName"]=> string(8) "BuscaSMS" ["className"]=> string(0) "" ["id"]=> string(0) "" ["schemaTypeInfo"]=> NULL ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> string(22) "(object value omitted)" ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (27) { ["tagName"]=> string(8) "BuscaSMS" ["className"]=> string(0) "" ["id"]=> string(0) "" ["schemaTypeInfo"]=> NULL ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> string(22) "(object value omitted)" ["nextElementSibling"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }
Output for 8.3.0 - 8.3.14
object(DOMElement)#4 (27) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(8) "BuscaSMS" ["className"]=> string(0) "" ["id"]=> string(0) "" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> string(22) "(object value omitted)" ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (27) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(8) "BuscaSMS" ["className"]=> string(0) "" ["id"]=> string(0) "" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> string(22) "(object value omitted)" ["nextElementSibling"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25
object(DOMElement)#4 (23) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(8) "BuscaSMS" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> string(22) "(object value omitted)" ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (23) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(8) "BuscaSMS" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> string(22) "(object value omitted)" ["nextElementSibling"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }
Output for 8.0.0 - 8.0.30
object(DOMElement)#4 (23) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> string(22) "(object value omitted)" ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (23) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(8) ["previousElementSibling"]=> string(22) "(object value omitted)" ["nextElementSibling"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
object(DOMElement)#4 (18) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (18) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }
Output for 5.6.0 - 5.6.40
object(DOMElement)#3 (18) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(196) " 999999999 9999999999 obrigado MO 2018-02-01T13:30:51.547-02:00 2018-02-01T13:30:52.773-02:00 2018-02-01T13:30:52.773-02:00 5 " } object(DOMElement)#5 (18) { ["tagName"]=> string(8) "BuscaSMS" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(8) "BuscaSMS" ["nodeValue"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " ["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"]=> 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(8) "BuscaSMS" ["baseURI"]=> string(1) "/" ["textContent"]=> string(198) " 99999999999 9999999999 Obrigado. MO 2018-02-01T13:37:17.18-02:00 2018-02-01T13:37:20.807-02:00 2018-02-01T13:37:20.807-02:00 5 " }

preferences:
103.25 ms | 438 KiB | 5 Q