3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xmlfile = <<< EOT <?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2014-04-05 23:02:44</currentTime> <result> <rowset name="skillGroups" key="groupID" columns="groupName,groupID"> <row groupName="Planet Management" groupID="1241"> <rowset name="skills" key="typeID" columns="typeName,groupID,typeID,published"> <row typeName="Advanced Planetology" groupID="1241" typeID="2403" published="1"> <description> The advanced understanding of planet evolution allowing you to interpret data from scans of planets for resources at much higher resolutions. Bonus: The skill further increases the resolution of resource data when scanning a planet to allow for very precise surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>5</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="2406" skillLevel="4"/> </rowset> <requiredAttributes> <secondaryAttribute>memory</secondaryAttribute> <primaryAttribute>intelligence</primaryAttribute> </requiredAttributes> <rowset name="skillBonusCollection" key="bonusType" columns="bonusType,bonusValue"> <row bonusType="canNotBeTrainedOnTrial" bonusValue="1"/> </rowset> </row> <row typeName="Planetology" groupID="1241" typeID="2406" published="1"> <description> The understanding of planet evolution allowing you to better interpret data from scans of planets for resources. Bonus: The skill increases the resolution of resource data when scanning a planet to allow for more accurate surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>3</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="13279" skillLevel="3"/> <row typeID="3402" skillLevel="4"/> </rowset> <requiredAttributes> <primaryAttribute>intelligence</primaryAttribute> <secondaryAttribute>memory</secondaryAttribute> </requiredAttributes> <rowset name="skillBonusCollection" key="bonusType" columns="bonusType,bonusValue"> <row bonusType="canNotBeTrainedOnTrial" bonusValue="1"/> </rowset> </row> <row typeName="Interplanetary Consolidation" groupID="1241" typeID="2495" published="1"> <description> For each level in this skill, you may install a command center on one additional planet, to a maximum of 6 planets. You can have only one command center per planet. Cannot be trained on Trial Accounts. </description> <rank>4</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"/> <requiredAttributes> <secondaryAttribute>intelligence</secondaryAttribute> <primaryAttribute>charisma</primaryAttribute> </requiredAttributes> <rowset name="skillBonusCollection" key="bonusType" columns="bonusType,bonusValue"> <row bonusType="canNotBeTrainedOnTrial" bonusValue="1"/> </rowset> </row> <row typeName="Command Center Upgrades" groupID="1241" typeID="2505" published="1"> <description> Each level in this skill improves the quality of command facility available to you, in turn allowing for a greater number of connected facilities on that planet. Cannot be trained on Trial Accounts. </description> <rank>4</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"/> <requiredAttributes> <primaryAttribute>charisma</primaryAttribute> <secondaryAttribute>intelligence</secondaryAttribute> </requiredAttributes> <rowset name="skillBonusCollection" key="bonusType" columns="bonusType,bonusValue"> <row bonusType="canNotBeTrainedOnTrial" bonusValue="1"/> </rowset> </row> </rowset> </row> </rowset> </result> <cachedUntil>2013-10-01 18:57:01</cachedUntil> </eveapi> EOT; $sg = "1241"; $xml = simplexml_load_file($xmlfile); foreach($xml->result->rowset->row as $row){ if ((string)$row['groupID'] == $sg) { foreach($row->rowset->row as $row1) { $typename = (string)$row1['typeName']; $typeid = (string)$row1['typeID']; $public = (string)$row1['published']; $description = (string)$row1->description; $groupid = (string)$row1['groupID']; $primaryattr = (string)$row1->requiredAttributes->primaryAttribute; $secondaryattr = (string)$row1->requiredAttributes->secondaryAttribute; $rank = (string)$row1->rank; $cost = "0"; echo $typeid . " " . $typename . " " . $description . " " . $public . " " . $groupid . " " . $primaryattr . " " . $secondaryattr . " " . $rank . " " . $cost . " " . "<br>"; } } } ?>
Output for 5.2.1 - 5.6.28, 7.0.0 - 7.1.0
Warning: simplexml_load_file(): I/O warning : failed to load external entity "<?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2014-04-05 23:02:44</currentTime> <result> <rowset name="skillGroups" key="groupID" columns="groupName,groupID"> <row groupName="Planet Management" groupID="1241"> <rowset name="skills" key="typeID" columns="typeName,groupID,typeID,published"> <row typeName="Advanced Planetology" groupID="1241" typeID="2403" published="1"> <description> The advanced understanding of planet evolution allowing you to interpret data from scans of planets for resources at much higher resolutions. Bonus: The skill further increases the resolution of resource data when scanning a planet to allow for very precise surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>5</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="2406" skillLevel="4"/> </rowset> <requi in /in/bXdG2 on line 81 Notice: Trying to get property of non-object in /in/bXdG2 on line 83 Notice: Trying to get property of non-object in /in/bXdG2 on line 83 Notice: Trying to get property of non-object in /in/bXdG2 on line 83 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 83
Output for hhvm-3.10.0 - 3.12.0
Warning: No such file or directory in /in/bXdG2 on line 81 Notice: Cannot access property on non-object in /in/bXdG2 on line 83 Notice: Cannot access property on non-object in /in/bXdG2 on line 83 Notice: Cannot access property on non-object in /in/bXdG2 on line 83 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 102
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.2.0
Warning: simplexml_load_file(): I/O warning : failed to load external entity "<?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2014-04-05 23:02:44</currentTime> <result> <rowset name="skillGroups" key="groupID" columns="groupName,groupID"> <row groupName="Planet Management" groupID="1241"> <rowset name="skills" key="typeID" columns="typeName,groupID,typeID,published"> <row typeName="Advanced Planetology" groupID="1241" typeID="2403" published="1"> <description> The advanced understanding of planet evolution allowing you to interpret data from scans of planets for resources at much higher resolutions. Bonus: The skill further increases the resolution of resource data when scanning a planet to allow for very precise surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>5</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="2406" skillLevel="4"/> </rowset> <requi in /in/bXdG2 on line 81 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 83
Output for 5.1.2
Warning: simplexml_load_file(): I/O warning : failed to load external entity "<?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2014-04-05 23:02:44</currentTime> <result> <rowset name="skillGroups" key="groupID" columns="groupName,groupID"> <row groupName="Planet Management" groupID="1241"> <rowset name="skills" key="typeID" columns="typeName,groupID,typeID,published"> <row typeName="Advanced Planetology" groupID="1241" typeID="2403" published="1"> <description> The advanced understanding of planet evolution allowing you to interpret data from scans of planets for resources at much higher resolutions. Bonus: The skill further increases the resolution of resource data when scanning a planet to allow for very precise surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>5</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="2406" skillLevel="4"/> </rowset> <requi in /in/bXdG2 on line 82 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 84
Output for 5.0.0 - 5.0.5
Warning: I/O warning : failed to load external entity "<?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2014-04-05 23:02:44</currentTime> <result> <rowset name="skillGroups" key="groupID" columns="groupName,groupID"> <row groupName="Planet Management" groupID="1241"> <rowset name="skills" key="typeID" columns="typeName,groupID,typeID,published"> <row typeName="Advanced Planetology" groupID="1241" typeID="2403" published="1"> <description> The advanced understanding of planet evolution allowing you to interpret data from scans of planets for resources at much higher resolutions. Bonus: The skill further increases the resolution of resource data when scanning a planet to allow for very precise surveying. Note: this skill cannot be trained on trial accounts. </description> <rank>5</rank> <rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel"> <row typeID="2406" skillLevel="4"/> </rowset> <requiredAttributes> < in /in/bXdG2 on line 81 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 83
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_file() in /in/bXdG2 on line 81
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_file() in /in/bXdG2 on line 81
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_file() in /in/bXdG2 on line 82
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_file() in /in/bXdG2 on line 81