From: dtorop933 at gmail dot com
Operating system: Linux
PHP version: 5.1.4
PHP Bug Type: XML related
Bug description: warning upon disabling handler via xml_set_element_handler
Description:
------------
The documentation for xml_set_element_handler says:
"If a handler function is set to an empty string, or FALSE, the handler in
question is disabled."
Unfortunately, I get a PHP Warning if the handler is disabled (rather
than, preferrably, silently skipping the handler).
I have tested this on 5.1.4 and 5.2.0RC2 from CVS.
This may be related to bug #2377?
Reproduce code:
---------------
<?php
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, '', '') or
die("Could not set up element handlers\n");
xml_parse($xml_parser, '<test/>', TRUE) or
die("Could not parse XML\n");
xml_parser_free($xml_parser);
?>
Expected result:
----------------
[NO OUTPUT]
Actual result:
--------------
Warning: xml_parse(): Unable to call handler () in /tmp/handler_test.php
on line 6
Warning: xml_parse(): Unable to call handler () in /tmp/handler_test.php
on line 6
--
Edit bug report at http://bugs.php.net/?id=38454&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38454&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38454&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38454&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38454&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38454&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38454&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38454&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38454&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38454&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38454&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38454&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38454&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38454&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38454&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38454&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38454&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38454&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38454&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38454&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38454&r=mysqlcfg