3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <DataSet> <schema id="OutDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <element name="OutDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> <complexType> <choice minOccurs="0" maxOccurs="unbounded"> <element name="BuscaSMS"> <complexType> <sequence> <element name="seunum" type="string" minOccurs="0" /> <element name="celular" type="string" minOccurs="0" /> <element name="mensagem" type="string" minOccurs="0" /> <element name="status" type="string" minOccurs="0" /> <element name="datarec" type="dateTime" minOccurs="0" /> <element name="dataenv" type="dateTime" minOccurs="0" /> <element name="datastatus" type="dateTime" minOccurs="0" /> <element name="op" type="short" minOccurs="0" /> </sequence> </complexType> </element> </choice> </complexType> </element> </schema> <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> </diffgram> </DataSet> XML; $simpleXml = simplexml_load_string($xml); var_dump($simpleXml);
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.10, 8.1rc1 - rc2
object(SimpleXMLElement)#1 (2) { ["schema"]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["id"]=> string(10) "OutDataSet" } ["element"]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["name"]=> string(10) "OutDataSet" } ["complexType"]=> object(SimpleXMLElement)#5 (1) { ["choice"]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(2) { ["minOccurs"]=> string(1) "0" ["maxOccurs"]=> string(9) "unbounded" } ["element"]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["name"]=> string(8) "BuscaSMS" } ["complexType"]=> object(SimpleXMLElement)#8 (1) { ["sequence"]=> object(SimpleXMLElement)#9 (1) { ["element"]=> array(8) { [0]=> object(SimpleXMLElement)#10 (1) { ["@attributes"]=> array(3) { ["name"]=> string(6) "seunum" ["type"]=> string(6) "string" ["minOccurs"]=> string(1) "0" } } [1]=> object(SimpleXMLElement)#11 (1) { ["@attributes"]=> array(3) { ["name"]=> string(7) "celular" ["type"]=> string(6) "string" ["minOccurs"]=> string(1) "0" } } [2]=> object(SimpleXMLElement)#12 (1) { ["@attributes"]=> array(3) { ["name"]=> string(8) "mensagem" ["type"]=> string(6) "string" ["minOccurs"]=> string(1) "0" } } [3]=> object(SimpleXMLElement)#13 (1) { ["@attributes"]=> array(3) { ["name"]=> string(6) "status" ["type"]=> string(6) "string" ["minOccurs"]=> string(1) "0" } } [4]=> object(SimpleXMLElement)#14 (1) { ["@attributes"]=> array(3) { ["name"]=> string(7) "datarec" ["type"]=> string(8) "dateTime" ["minOccurs"]=> string(1) "0" } } [5]=> object(SimpleXMLElement)#15 (1) { ["@attributes"]=> array(3) { ["name"]=> string(7) "dataenv" ["type"]=> string(8) "dateTime" ["minOccurs"]=> string(1) "0" } } [6]=> object(SimpleXMLElement)#16 (1) { ["@attributes"]=> array(3) { ["name"]=> string(10) "datastatus" ["type"]=> string(8) "dateTime" ["minOccurs"]=> string(1) "0" } } [7]=> object(SimpleXMLElement)#17 (1) { ["@attributes"]=> array(3) { ["name"]=> string(2) "op" ["type"]=> string(5) "short" ["minOccurs"]=> string(1) "0" } } } } } } } } } } ["diffgram"]=> object(SimpleXMLElement)#3 (1) { ["OutDataSet"]=> object(SimpleXMLElement)#4 (1) { ["BuscaSMS"]=> array(2) { [0]=> object(SimpleXMLElement)#5 (8) { ["seunum"]=> string(9) "999999999" ["celular"]=> string(10) "9999999999" ["mensagem"]=> string(8) "obrigado" ["status"]=> string(2) "MO" ["datarec"]=> string(29) "2018-02-01T13:30:51.547-02:00" ["dataenv"]=> string(29) "2018-02-01T13:30:52.773-02:00" ["datastatus"]=> string(29) "2018-02-01T13:30:52.773-02:00" ["op"]=> string(1) "5" } [1]=> object(SimpleXMLElement)#6 (8) { ["seunum"]=> string(11) "99999999999" ["celular"]=> string(10) "9999999999" ["mensagem"]=> string(9) "Obrigado." ["status"]=> string(2) "MO" ["datarec"]=> string(28) "2018-02-01T13:37:17.18-02:00" ["dataenv"]=> string(29) "2018-02-01T13:37:20.807-02:00" ["datastatus"]=> string(29) "2018-02-01T13:37:20.807-02:00" ["op"]=> string(1) "5" } } } } }

preferences:
80.7 ms | 479 KiB | 5 Q