3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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"> <rowset name="roles" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRoles" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtHQ" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtHQ" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtBase" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtBase" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtOther" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtOther" key="roleID" columns="roleID,roleName" /> <rowset name="titles" key="titleID" columns="titleID,titleName"> <row titleID="256" titleName="Tiger" /> </rowset> </row> <row characterID="555" name="John"> <rowset name="roles" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRoles" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtHQ" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtHQ" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtBase" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtBase" key="roleID" columns="roleID,roleName" /> <rowset name="rolesAtOther" key="roleID" columns="roleID,roleName" /> <rowset name="grantableRolesAtOther" key="roleID" columns="roleID,roleName" /> <rowset name="titles" key="titleID" columns="titleID,titleName"> <row titleID="16" titleName="R &amp; D" /> <row titleID="64" titleName="Miner" /> <row titleID="256" titleName="Tiger" /> <row titleID="16384" titleName="POS Manager" /> </rowset> </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->row as $row) { echo "here"; /*$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";*/ }
based on KpjFA
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
herehere
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/ieSuo on line 43
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/ieSuo on line 43
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/ieSuo on line 44
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/ieSuo on line 43