3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< EOT <?xml version='1.0' encoding='UTF-8'?> <rowset name="keys" key="keyID" columns="keyID,vCode"> <row keyID="3169149" vCode="FQVKg5iK2k5gnMnafK6fn0K3QUKnWzjRoSv5C2TpgEtC8qFqH9Ism2E4IcFOPkgR" /> <row keyID="3184662" vCode="u7G74sPhQgKz7AqYclI40xlHWqbc7b8bZzPYDC0B4tPXnvNLHu8XbbGyert1YLMs" /> </rowset> EOT; $simpleXML = simplexml_load_string($xml); // Load XML string data into the simplexml object parser foreach ($simpleXML->result->rowset->row as $row) { $titles = []; $name = $row['name']->__toString(); foreach($row as $attrib){ if($attrib['name']->__toString() === 'titles'){ foreach($attrib as $title){ $titles[] = $title['titleName']->__toString(); } } } echo $name . ' : ' . implode(' - ', $titles) . "<br/>\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Attempt to read property "row" on null in /in/MKWZm on line 12 Warning: foreach() argument must be of type array|object, null given in /in/MKWZm on line 12

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:
41.88 ms | 401 KiB | 8 Q