3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.6
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> <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>" in /in/bXdG2 on line 81 Warning: Attempt to read property "result" on false in /in/bXdG2 on line 83 Warning: Attempt to read property "rowset" on null in /in/bXdG2 on line 83 Warning: Attempt to read property "row" on null in /in/bXdG2 on line 83 Warning: foreach() argument must be of type array|object, null given in /in/bXdG2 on line 83
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
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> <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>" in /in/bXdG2 on line 81 Warning: Attempt to read property "result" on bool in /in/bXdG2 on line 83 Warning: Attempt to read property "rowset" on null in /in/bXdG2 on line 83 Warning: Attempt to read property "row" on null in /in/bXdG2 on line 83 Warning: foreach() argument must be of type array|object, null given in /in/bXdG2 on line 83
Output for 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.33
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 'result' of non-object in /in/bXdG2 on line 83 Notice: Trying to get property 'rowset' of non-object in /in/bXdG2 on line 83 Notice: Trying to get property 'row' of non-object in /in/bXdG2 on line 83 Warning: Invalid argument supplied for foreach() in /in/bXdG2 on line 83
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.1.6, 5.2.0, 7.3.32 - 7.3.33
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.2.1 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
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 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.3.11, 4.4.0 - 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

preferences:
250.07 ms | 401 KiB | 310 Q