3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< EOT <?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2013-10-01 18:00:01</currentTime> <result> <rowset name="members" key="characterID" columns="characterID, name"> <row characterID="2234" name="Bob"> <format type="test">Bob format</format> </row> <row characterID="555" name="John">test1 <format type="test">John format</format> </row> </rowset> </result> <cachedUntil>2013-10-01 18:57:01</cachedUntil> </eveapi> EOT; $simpleXML = simplexml_load_string($xml); // Load XML string data into the simplexml object parser foreach ($simpleXML->result->rowset as $rowset) { foreach ($rowset->row as $row) { $titles = []; echo "cp "; print_r($row->format); echo " cp "; $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
cp SimpleXMLElement Object ( [@attributes] => Array ( [type] => test ) [0] => Bob format ) cp Fatal error: Uncaught Error: Call to a member function __toString() on null in /in/kVBMq:30 Stack trace: #0 {main} thrown in /in/kVBMq on line 30
Process exited with code 255.

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