ID:               34278
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gk at proliberty dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Documentation problem
 Operating System: Linux
 PHP Version:      Irrelevant
 New Comment:

Status of this bug will be tracked under bug #12261.


Previous Comments:
------------------------------------------------------------------------

[2005-08-27 11:13:50] gk at proliberty dot com

Description:
------------
The documentation says, that options for xml_parser_get_option are
defined in  xml_parser_set_option - i.e., none of these options are
'unsupported'.

However, E_WARNING errors are generated by passing 'unsupported'
options to xml_parser_get_option.

E_WARNING indicates a serious problem (in my case, I always use a
custom error handler that elevates E_WARNING errors to E_USER_ERROR
(fatal) status).

Furthermore, I argue, xml_parser_get_option SHOULD INDEED support ALL
options that xml_parser_set_option supports since code should be able
to query the environment in which it runs.

Also, for the sake of consistency with other set/get functions, these
two functions should support the same options.

SEE RELATED BUG:
Bug #12261      xml_parser_get_option doesn't get all option that
xml_parser_set_option can set
http://bugs.php.net/bug.php?id=12261

Reproduce code:
---------------
<?php
$parser = xml_parser_create();
echo "XML_OPTION_CASE_FOLDING=".xml_parser_get_option
($parser,XML_OPTION_CASE_FOLDING)."\n<br>";
echo "XML_OPTION_TARGET_ENCODING=".xml_parser_get_option
($parser,XML_OPTION_TARGET_ENCODING)."\n<br>";
echo "XML_OPTION_SKIP_TAGSTART=".xml_parser_get_option
($parser,XML_OPTION_SKIP_TAGSTART)."\n<br>";
echo "XML_OPTION_SKIP_WHITE=".xml_parser_get_option
($parser,XML_OPTION_SKIP_WHITE)."\n<br>";
?>

Expected result:
----------------
XML_OPTION_CASE_FOLDING=1 
XML_OPTION_TARGET_ENCODING=UTF-8 
XML_OPTION_SKIP_TAGSTART=<current value>
XML_OPTION_SKIP_WHITE=<current value>

Actual result:
--------------
XML_OPTION_CASE_FOLDING=1 
XML_OPTION_TARGET_ENCODING=UTF-8 

Warning: xml_parser_get_option() [function.xml-parser-get-option]:
Unknown option in /usr/local/apache/htdocs/test/test.php on line 5
XML_OPTION_SKIP_TAGSTART= 

Warning: xml_parser_get_option() [function.xml-parser-get-option]:
Unknown option in /usr/local/apache/htdocs/test/test.php on line 6
XML_OPTION_SKIP_WHITE=


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34278&edit=1

Reply via email to