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); function formatNode(\DOMNode $node) : string { if (!$node->hasChildNodes()) { return $node->nodeName.': '.$node->nodeValue; } return $node->nodeName."\n\t".formatList($node->childNodes); } function formatList(\DOMNodeList $list) { $array = []; foreach($list as $node) { $array[] = formatNode($node); } return implode("\n" , $array); } echo formatNode($dom);
Output for git.master, git.master_jit, rfc.property-hooks
#document DataSet #text: xs:schema #text: xs:element #text: xs:complexType #text: xs:choice #text: xs:element #text: xs:complexType #text: xs:sequence #text: xs:element: #text: xs:element: #text: xs:element: #text: xs:element: #text: xs:element: #text: xs:element: #text: xs:element: #text: xs:element: #text: #text: #text: #text: #text: #text: #text: #text: diffgr:diffgram #text: OutDataSet #text: BuscaSMS #text: seunum #text: 999999999 #text: celular #text: 9999999999 #text: mensagem #text: obrigado #text: status #text: MO #text: datarec #text: 2018-02-01T13:30:51.547-02:00 #text: dataenv #text: 2018-02-01T13:30:52.773-02:00 #text: datastatus #text: 2018-02-01T13:30:52.773-02:00 #text: op #text: 5 #text: #text: BuscaSMS #text: seunum #text: 99999999999 #text: celular #text: 9999999999 #text: mensagem #text: Obrigado. #text: status #text: MO #text: datarec #text: 2018-02-01T13:37:17.18-02:00 #text: dataenv #text: 2018-02-01T13:37:20.807-02:00 #text: datastatus #text: 2018-02-01T13:37:20.807-02:00 #text: op #text: 5 #text: #text: #text: #text:

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:
28.9 ms | 410 KiB | 5 Q