1--TEST-- 2xml_error_string() - Basic test on 5 error codes 3--EXTENSIONS-- 4xml 5--FILE-- 6<?php 7$xmls = array( 8 '<?xml version="1.0"?><element>', 9 '<?xml>', 10 '<?xml version="dummy">', 11 '<?xml?>', 12 '<?xml version="1.0"?><elem></element>', 13); 14 15foreach ($xmls as $xml) { 16 $xml_parser = xml_parser_create(); 17 if (!xml_parse($xml_parser, $xml, true)) { 18 var_dump(xml_get_error_code($xml_parser)); 19 var_dump(xml_error_string(xml_get_error_code($xml_parser))); 20 } 21 xml_parser_free($xml_parser); 22} 23?> 24--EXPECTF-- 25int(%r5|77%r) 26string(%d) %r"Invalid document end"|"Tag not finished"%r 27int(47) 28string(35) "Processing Instruction not finished" 29int(57) 30string(28) "XML declaration not finished" 31int(64) 32string(17) "Reserved XML Name" 33int(76) 34string(14) "Mismatched tag" 35