3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <MembershipCardInfo><CardNo>8898990000000083</CardNo><MemberID>1144582</MemberID><PrintedName /><MembershipTypeCode>MSR</MembershipTypeCode><MembershipStatusCode>ACTIVE</MembershipStatusCode><MembershipPhoto>8898990000000083.jpg</MembershipPhoto><IssueDate>2014-09-15T00:00:00</IssueDate><EffectiveDate>2014-09-15T00:00:00</EffectiveDate><ExpiryDate>2015-09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" /><tmpMembershipStatusCode /><PointsBAL>0.0000</PointsBAL><Remarks /><MembershipDiscount>0</MembershipDiscount><TierCode>Welcome</TierCode><TotalSpending>0</TotalSpending><TotalNettSpending>0</TotalNettSpending><TotalPoints>0</TotalPoints><TotalVisits>0</TotalVisits><LastVisitedOutletCode /><MostCycleVisitedOutletCode>394</MostCycleVisitedOutletCode><TotalCycleVisits>0</TotalCycleVisits><TotalCycleSpending>0</TotalCycleSpending><TotalCycleNettSpending>0</TotalCycleNettSpending><TotalCyclePoints>0</TotalCyclePoints><TotalBalPoints>0</TotalBalPoints><CurrentMonthSpending>0</CurrentMonthSpending><CurrentMonth_1Spending>0</CurrentMonth_1Spending><CurrentMonth_2Spending>0</CurrentMonth_2Spending><CurrentMonthNettSpending>0</CurrentMonthNettSpending><CurrentMonth_1NettSpending>0</CurrentMonth_1NettSpending><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo><MembershipCardInfo><CardNo>8898000000000260</CardNo><MemberID>1144582</MemberID><PrintedName>Test</PrintedName><MembershipTypeCode>MSR</MembershipTypeCode><MembershipStatusCode>ACTIVE</MembershipStatusCode><MembershipPhoto>Featured.jpg</MembershipPhoto><IssueDate>2014-09-19T00:00:00</IssueDate><EffectiveDate>2014-09-19T00:00:00</EffectiveDate><ExpiryDate>2017-09-20T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" /><tmpMembershipStatusCode /><PointsBAL>0.0000</PointsBAL><Remarks /><MembershipDiscount>0</MembershipDiscount><TierCode>Unassigned</TierCode><TotalSpending>18.2</TotalSpending><TotalNettSpending>18</TotalNettSpending><TotalPoints>0</TotalPoints><TotalVisits>1</TotalVisits><LastVisitedOutletCode>394</LastVisitedOutletCode><MostCycleVisitedOutletCode /><TotalCycleVisits>1</TotalCycleVisits><TotalCycleSpending>18.2</TotalCycleSpending><TotalCycleNettSpending>18</TotalCycleNettSpending><TotalCyclePoints>0</TotalCyclePoints><TotalBalPoints>0</TotalBalPoints><CurrentMonthSpending>18.2</CurrentMonthSpending><CurrentMonth_1Spending>0</CurrentMonth_1Spending><CurrentMonth_2Spending>0</CurrentMonth_2Spending><CurrentMonthNettSpending>0</CurrentMonthNettSpending><CurrentMonth_1NettSpending>0</CurrentMonth_1NettSpending><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> XML; $xml = simplexml_load_string($x); $i = 0; foreach ($xml->MembershipCardInfo as $card): $cardArray[$i] = $card->CardNo; $i++; endforeach; foreach ($cardArray as $item) { echo $item.'<br />'; }
Output for git.master, git.master_jit
Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on PrintedDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): -09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): rinted>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpEffectiveDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpExpiryDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): i:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/5uf2h on line 6 Warning: simplexml_load_string(): ><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: Attempt to read property "MembershipCardInfo" on bool in /in/5uf2h on line 9 Warning: foreach() argument must be of type array|object, null given in /in/5uf2h on line 9 Warning: Undefined variable $cardArray in /in/5uf2h on line 14 Warning: foreach() argument must be of type array|object, null given in /in/5uf2h on line 14
Output for rfc.property-hooks
Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on PrintedDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): -09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): rinted>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpEffectiveDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpExpiryDate is not defined in /in/5uf2h on line 6 Warning: simplexml_load_string(): i:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/5uf2h on line 6 Warning: simplexml_load_string(): ><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> in /in/5uf2h on line 6 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 6 Warning: Attempt to read property "MembershipCardInfo" on false in /in/5uf2h on line 9 Warning: foreach() argument must be of type array|object, null given in /in/5uf2h on line 9 Warning: Undefined variable $cardArray in /in/5uf2h on line 14 Warning: foreach() argument must be of type array|object, null given in /in/5uf2h on line 14

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:
52.42 ms | 409 KiB | 8 Q