From:             gk at proliberty dot com
Operating system: Linux
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  xml_parser_get_option manual fails to specify options causing 
E_WARNING

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 bug report at http://bugs.php.net/?id=34278&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34278&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34278&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34278&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34278&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34278&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34278&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34278&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34278&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34278&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34278&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34278&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34278&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34278&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34278&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34278&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34278&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34278&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34278&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34278&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34278&r=mysqlcfg

Reply via email to