3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ReadXml($xmlstr) { $p = xml_parser_create(); xml_parser_set_option ($p, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($p, $xmlstr, $vals); xml_parser_free($p); return ($vals[0]['tag'].PHP_EOL. $vals[1]['tag'].’: ‘.$vals[1]['value'].PHP_EOL. $vals[2]['tag'].’: ‘.$vals[2]['value'].PHP_EOL. $vals[3]['tag'].’: ‘.$vals[3]['value'].PHP_EOL. $vals[4]['tag'].’: ‘.$vals[4]['value'].PHP_EOL); } $xmlstr= '<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>'; ReadXml($xmlstr);
Output for 5.3.0 - 5.4.14
Parse error: syntax error, unexpected ':' in /in/ePc8e on line 11
Process exited with code 255.