3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml=simplexml_load_string(<<<XML <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 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/5IV2K on line 16 Warning: simplexml_load_string(): <row id="1_3"> in /in/5IV2K on line 16 Warning: simplexml_load_string(): ^ in /in/5IV2K on line 16 Warning: Invalid argument supplied for foreach() in /in/5IV2K on line 23
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.6.28
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/5IV2K on line 18 Warning: simplexml_load_string(): <row id="1_3"> in /in/5IV2K on line 18 Warning: simplexml_load_string(): ^ in /in/5IV2K on line 18 Warning: Invalid argument supplied for foreach() in /in/5IV2K on line 23
Output for 5.1.2
Warning: simplexml_load_string(): Entity: line 8: parser error : Extra content at the end of the document in /in/5IV2K on line 19 Warning: simplexml_load_string(): <row id="1_3"> in /in/5IV2K on line 19 Warning: simplexml_load_string(): ^ in /in/5IV2K on line 19 Warning: Invalid argument supplied for foreach() in /in/5IV2K on line 24
Output for 5.0.0 - 5.0.5
Warning: Entity: line 8: parser error : Extra content at the end of the document in /in/5IV2K on line 18 Warning: <row id="1_3"> in /in/5IV2K on line 18 Warning: ^ in /in/5IV2K on line 18 Warning: Invalid argument supplied for foreach() in /in/5IV2K on line 23
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/5IV2K 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/5IV2K 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/5IV2K on line 2