3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = <<<HERE <!DOCTYPE test [ <!ENTITY test "test"> ]> <test foo="&test;">&test;</test> HERE; $parser = xml_parser_create(); xml_parse_into_struct($parser, $xml, $vals, $idx); print_r($vals); xml_parser_free($parser);
based on 1WjcW
Output for 7.1.25, 7.2.12 - 7.3.1
Array ( [0] => Array ( [tag] => TEST [type] => complete [level] => 1 [attributes] => Array ( [FOO] => test ) [value] => test ) )
Output for 5.5.0 - 7.1.20, 7.2.0 - 7.2.11
Array ( [0] => Array ( [tag] => TEST [type] => complete [level] => 1 [attributes] => Array ( [FOO] => test ) ) )