1--TEST-- 2Test xml_set_notation_decl_handler function : basic 3--SKIPIF-- 4<?php 5if (!extension_loaded("xml")) { 6 print "skip - XML extension not loaded"; 7} 8?> 9--FILE-- 10<?php 11/* Prototype : proto bool xml_set_notation_decl_handler ( resource $parser , callback $handler ) 12 * Description: Sets the notation declaration handler function for the XML parser. 13 * Source code: ext/xml/xml.c 14 * Alias to functions: 15 */ 16 17echo "Simple testcase for xml_parser_get_option() function\n"; 18 19$parser = xml_parser_create_ns(); 20 21var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING)); 22var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING)); 23 24var_dump(xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 1)); 25var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1")); 26 27var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING)); 28var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING)); 29 30var_dump(xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0)); 31var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8")); 32 33var_dump(xml_parser_get_option($parser, XML_OPTION_CASE_FOLDING)); 34var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING)); 35 36var_dump(xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "US-ASCII")); 37var_dump(xml_parser_get_option($parser, XML_OPTION_TARGET_ENCODING)); 38 39xml_parser_free( $parser ); 40 41echo "Done\n"; 42?> 43--EXPECT-- 44Simple testcase for xml_parser_get_option() function 45int(1) 46string(5) "UTF-8" 47bool(true) 48bool(true) 49int(1) 50string(10) "ISO-8859-1" 51bool(true) 52bool(true) 53int(0) 54string(5) "UTF-8" 55bool(true) 56string(8) "US-ASCII" 57Done 58