3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml=simplexml_load_string(<<<XML <row id="1_1"> <col1>Constituency</col1> <col2>State</col2> <col3>Election date</col3> <col4>Wikipedia link</col4> <col5>Election.in link</col5> </row> <row id="1_2"> <col1>Adilabad</col1> <col2>Andhra Pradesh</col2> <col3>30-Apr-2014</col3> <col4>http://en.wikipedia.org/wiki/Adilabad_(Lok_Sabha_constituency)</col4> <col5>http://www.elections.in/andhra-pradesh/parliamentary-constituencies/adilabad.html</col5> </row> <row id="1_3"> <col1>Peddapalli</col1> <col2>Andhra Pradesh</col2> <col3>30-Apr-2014</col3> <col4>http://en.wikipedia.org/wiki/Peddapalli_(Lok_Sabha_constituency)</col4> <col5>http://www.elections.in/andhra-pradesh/parliamentary-constituencies/peddapalli.html</col5> </row> XML ); $row = $xml; foreach ($row->Entry as $Entry) { echo $Entry->col1.' , '.$Entry->col2.' <br />'; }
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/UP4Sv on line 23 Warning: simplexml_load_string(): <row id="1_2"> in /in/UP4Sv on line 23 Warning: simplexml_load_string(): ^ in /in/UP4Sv on line 23 Notice: Trying to get property of non-object in /in/UP4Sv on line 30 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 30
Output for hhvm-3.10.0 - 3.12.0
Notice: Cannot access property on non-object in /in/UP4Sv on line 30 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 34 Entity: line 8: parser error : Extra content at the end of the document <row id="1_2"> ^
Output for 5.2.1 - 5.6.28
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/UP4Sv on line 25 Warning: simplexml_load_string(): <row id="1_2"> in /in/UP4Sv on line 25 Warning: simplexml_load_string(): ^ in /in/UP4Sv on line 25 Notice: Trying to get property of non-object in /in/UP4Sv on line 30 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 30
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.2.0
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/UP4Sv on line 25 Warning: simplexml_load_string(): <row id="1_2"> in /in/UP4Sv on line 25 Warning: simplexml_load_string(): ^ in /in/UP4Sv on line 25 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 30
Output for 5.1.2
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/UP4Sv on line 26 Warning: simplexml_load_string(): <row id="1_2"> in /in/UP4Sv on line 26 Warning: simplexml_load_string(): ^ in /in/UP4Sv on line 26 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 31
Output for 5.0.0 - 5.0.5
Warning: Entity: line 8: parser error : Extra content at the end of the document in /in/UP4Sv on line 25 Warning: <row id="1_2"> in /in/UP4Sv on line 25 Warning: ^ in /in/UP4Sv on line 25 Warning: Invalid argument supplied for foreach() in /in/UP4Sv on line 30
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/UP4Sv on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/UP4Sv on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/UP4Sv on line 2