3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<< EOT <?xml version='1.0' encoding='UTF-8'?> <rowset name="keys" key="keyID" columns="keyID,vCode"> <row keyID="3169149" vCode="FQVKg5iK2k5gnMnafK6fn0K3QUKnWzjRoSv5C2TpgEtC8qFqH9Ism2E4IcFOPkgR" /> <row keyID="3184662" vCode="u7G74sPhQgKz7AqYclI40xlHWqbc7b8bZzPYDC0B4tPXnvNLHu8XbbGyert1YLMs" /> </rowset> EOT; $simpleXML = simplexml_load_string($xml); // Load XML string data into the simplexml object parser foreach ($simpleXML->rowset->row as $row) { $keyID = $row['keyID']->__toString(); $vCode = $row['vCode']->__toString(); echo $keyID . ' : ' . $vCode; }
Output for 5.0.0 - 5.1.1, 5.2.1 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/dbhZt on line 12
Output for 5.1.3 - 5.2.0
Output for 5.1.2
Warning: Invalid argument supplied for foreach() in /in/dbhZt on line 13
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/dbhZt on line 10
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/dbhZt on line 10
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/dbhZt on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/dbhZt on line 10