3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = <<<XML <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><MembershipCardInfo><CardNo>8898000000000260</CardNo> </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 1HQ0f
Output for 7.2.0
Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/NKo2I on line 7 Warning: simplexml_load_string(): <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><Membe in /in/NKo2I on line 7 Warning: simplexml_load_string(): ^ in /in/NKo2I on line 7 Notice: Trying to get property 'MembershipCardInfo' of non-object in /in/NKo2I on line 10 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 10 Notice: Undefined variable: cardArray in /in/NKo2I on line 15 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 15
Output for 5.2.1 - 7.1.10
Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/NKo2I on line 7 Warning: simplexml_load_string(): <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><Membe in /in/NKo2I on line 7 Warning: simplexml_load_string(): ^ in /in/NKo2I on line 7 Notice: Trying to get property of non-object in /in/NKo2I on line 10 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 10 Notice: Undefined variable: cardArray in /in/NKo2I on line 15 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 15
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.2.0
Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/NKo2I on line 7 Warning: simplexml_load_string(): <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><Membe in /in/NKo2I on line 7 Warning: simplexml_load_string(): ^ in /in/NKo2I on line 7 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 10 Notice: Undefined variable: cardArray in /in/NKo2I on line 15 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 15
Output for 5.1.2
Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/NKo2I on line 8 Warning: simplexml_load_string(): <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><Membe in /in/NKo2I on line 8 Warning: simplexml_load_string(): ^ in /in/NKo2I on line 8 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 11 Notice: Undefined variable: cardArray in /in/NKo2I on line 16 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 16
Output for 5.0.0 - 5.0.5
Warning: Entity: line 1: parser error : Extra content at the end of the document in /in/NKo2I on line 7 Warning: <MembershipCardInfo><CardNo>8898990000000083</CardNo></MembershipCardInfo><Membe in /in/NKo2I on line 7 Warning: ^ in /in/NKo2I on line 7 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 10 Warning: Invalid argument supplied for foreach() in /in/NKo2I on line 15
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/NKo2I on line 7
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/NKo2I on line 7
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/NKo2I on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/NKo2I on line 7