3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 />'; }
based on 4IU2C
Output for 5.2.1 - 5.6.28, 7.0.0 - 7.1.0
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 Notice: Trying to get property of non-object in /in/5uf2h on line 9 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 9 Notice: Undefined variable: cardArray in /in/5uf2h on line 14 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 14
Output for hhvm-3.12.0
Notice: Cannot access property on non-object in /in/5uf2h on line 9 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 12 Notice: Undefined variable: cardArray in /in/5uf2h on line 16 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 16 namespace error : Namespace prefix xsi for nil on PrintedDate is not defined -09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" ^ namespace error : Namespace prefix xsi for nil on RenewedDate is not defined rinted>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" ^ namespace error : Namespace prefix xsi for nil on tmpEffectiveDate is not defined xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" ^ namespace error : Namespace prefix xsi for nil on tmpExpiryDate is not defined i:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" ^ Entity: line 1: parser error : Extra content at the end of the document ><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> ^
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.2.0
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: Invalid argument supplied for foreach() in /in/5uf2h on line 9 Notice: Undefined variable: cardArray in /in/5uf2h on line 14 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 14
Output for 5.1.2
Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on PrintedDate is not defined in /in/5uf2h on line 7 Warning: simplexml_load_string(): -09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" in /in/5uf2h on line 7 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 7 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/5uf2h on line 7 Warning: simplexml_load_string(): rinted>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" in /in/5uf2h on line 7 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 7 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpEffectiveDate is not defined in /in/5uf2h on line 7 Warning: simplexml_load_string(): xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" in /in/5uf2h on line 7 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 7 Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on tmpExpiryDate is not defined in /in/5uf2h on line 7 Warning: simplexml_load_string(): i:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" in /in/5uf2h on line 7 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 7 Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/5uf2h on line 7 Warning: simplexml_load_string(): ><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> in /in/5uf2h on line 7 Warning: simplexml_load_string(): ^ in /in/5uf2h on line 7 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 10 Notice: Undefined variable: cardArray in /in/5uf2h on line 15 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 15
Output for 5.0.0 - 5.0.5
Warning: namespace error : Namespace prefix xsi for nil on PrintedDate is not defined in /in/5uf2h on line 6 Warning: -09-15T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: ^ in /in/5uf2h on line 6 Warning: namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/5uf2h on line 6 Warning: rinted>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" in /in/5uf2h on line 6 Warning: ^ in /in/5uf2h on line 6 Warning: namespace error : Namespace prefix xsi for nil on tmpEffectiveDate is not defined in /in/5uf2h on line 6 Warning: xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" in /in/5uf2h on line 6 Warning: ^ in /in/5uf2h on line 6 Warning: namespace error : Namespace prefix xsi for nil on tmpExpiryDate is not defined in /in/5uf2h on line 6 Warning: i:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" in /in/5uf2h on line 6 Warning: ^ in /in/5uf2h on line 6 Warning: Entity: line 1: parser error : Extra content at the end of the document in /in/5uf2h on line 6 Warning: ><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipCardInfo> in /in/5uf2h on line 6 Warning: ^ in /in/5uf2h on line 6 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 9 Warning: Invalid argument supplied for foreach() in /in/5uf2h on line 14
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/5uf2h on line 6
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/5uf2h on line 6
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/5uf2h on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/5uf2h on line 6