3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = <<<XML <MembershipCardLists><MembershipCardInfo><CardNo>8898990000000083</CardNo><MemberID>1144582</MemberID><RenewedDate xsi:nil="true" /></MembershipCardInfo></MembershipCardLists> 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 sLrbo
Output for 5.1.0 - 5.1.1, 5.1.3 - 7.1.0
Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/qnE45 on line 6 Warning: simplexml_load_string(): 898990000000083</CardNo><MemberID>1144582</MemberID><RenewedDate xsi:nil="true" in /in/qnE45 on line 6 Warning: simplexml_load_string(): ^ in /in/qnE45 on line 6 8898990000000083<br />
Output for 5.1.2
Warning: simplexml_load_string(): namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/qnE45 on line 7 Warning: simplexml_load_string(): 898990000000083</CardNo><MemberID>1144582</MemberID><RenewedDate xsi:nil="true" in /in/qnE45 on line 7 Warning: simplexml_load_string(): ^ in /in/qnE45 on line 7 8898990000000083<br />
Output for 5.0.0 - 5.0.5
Warning: namespace error : Namespace prefix xsi for nil on RenewedDate is not defined in /in/qnE45 on line 6 Warning: 898990000000083</CardNo><MemberID>1144582</MemberID><RenewedDate xsi:nil="true" in /in/qnE45 on line 6 Warning: ^ in /in/qnE45 on line 6 8898990000000083<br />
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/qnE45 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/qnE45 on line 6
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/qnE45 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/qnE45 on line 6