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> <closedperiodlist> <!--Zero or more repetitions:--> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-11-11</startdate> <!--Optional:--> <enddate>2014-11-11</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Armistice</closeddescription> <closeddescription locale="fr">Armistice (fr)</closeddescription> <closeddescription locale="nl">Armistice (nl)</closeddescription> <closeddescription locale="de">Armistice (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-11-01</startdate> <!--Optional:--> <enddate>2014-11-01</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">All Saints Day</closeddescription> <closeddescription locale="fr">All Saints Day (fr)</closeddescription> <closeddescription locale="nl">All Saints Day (nl)</closeddescription> <closeddescription locale="de">All Saints Day (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-08-15</startdate> <!--Optional:--> <enddate>2014-08-15</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Assumption of Mary</closeddescription> <closeddescription locale="fr">Assumption of Mary(fr)</closeddescription> <closeddescription locale="nl">Assumption of Mary(nl)</closeddescription> <closeddescription locale="de">Assumption of Mary(de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-07-21</startdate> <!--Optional:--> <enddate>2014-07-21</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">National Holiday</closeddescription> <closeddescription locale="fr">National Holiday (fr)</closeddescription> <closeddescription locale="nl">National Holiday (nl)</closeddescription> <closeddescription locale="de">National Holiday (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-06-09</startdate> <!--Optional:--> <enddate>2014-06-09</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Whitsun Monday</closeddescription> <closeddescription locale="fr">Whitsun Monday (fr)</closeddescription> <closeddescription locale="nl">Whitsun Monday (nl)</closeddescription> <closeddescription locale="de">Whitsun Monday (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-06-08</startdate> <!--Optional:--> <enddate>2014-06-08</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Whitsun</closeddescription> <closeddescription locale="fr">Whitsun (fr)</closeddescription> <closeddescription locale="nl">Whitsun (nl)</closeddescription> <closeddescription locale="de">Whitsun (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-05-29</startdate> <!--Optional:--> <enddate>2014-05-29</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Ascension</closeddescription> <closeddescription locale="fr">Ascension (fr)</closeddescription> <closeddescription locale="nl">Ascension (nl)</closeddescription> <closeddescription locale="de">Ascension (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-05-01</startdate> <!--Optional:--> <enddate>2014-05-01</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Labour day</closeddescription> <closeddescription locale="fr">Labour day (fr)</closeddescription> <closeddescription locale="nl">Labour day (nl)</closeddescription> <closeddescription locale="de">Labour day (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-04-21</startdate> <!--Optional:--> <enddate>2014-04-21</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Easter Monday</closeddescription> <closeddescription locale="fr">Easter Monday (fr)</closeddescription> <closeddescription locale="nl">Easter Monday (nl)</closeddescription> <closeddescription locale="de">Easter Monday (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-04-20</startdate> <!--Optional:--> <enddate>2014-04-20</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">Easter</closeddescription> <closeddescription locale="fr">Easter (fr)</closeddescription> <closeddescription locale="nl">Easter (nl)</closeddescription> <closeddescription locale="de">Easter (de)</closeddescription> </closedperiod> <closedperiod> <openingaudience>PUBLIC</openingaudience> <period> <!--Optional:--> <startdate>2014-01-01</startdate> <!--Optional:--> <enddate>2014-01-01</enddate> </period> <!--1 or more repetitions:--> <closeddescription locale="en">New Year</closeddescription> <closeddescription locale="fr">Nouvelle Annee</closeddescription> <closeddescription locale="nl">Nieuwjaar</closeddescription> <closeddescription locale="de">New Jahr</closeddescription> </closedperiod> </closedperiodlist> <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) { $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/Lb0Gb on line 169 Warning: foreach() argument must be of type array|object, null given in /in/Lb0Gb on line 169

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