#27180 [Opn]: Callback parameters in xml_set_*_handler

From: Date: Sat, 07 Feb 2004 18:57:42 +0000
Subject: #27180 [Opn]: Callback parameters in xml_set_*_handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54537@lists.php.net to get a copy of this message
ID: 27180 User updated by: drm at melp dot nl Reported By: drm at melp dot nl Status: Open Bug Type: XML related Operating System: Windows XP PHP Version: 4.3.4 New Comment: I'm not sure. The documentation is not quite clear about not passing that type of callback functions to those functions. If the docs would be clear about that, there wouldn't be a problem (imho) Also, a special function 'xml_set_object' is available for this kind of callbacks, so i figured there are no plans on letting xml_set_*_handler functions handle the obj/method callbacks. That's the reason i posted it as a documentation problem. If the dev team would rather consider it a bug, that's even better :) Sorry if that puzzled you. Previous Comments: ------------------------------------------------------------------------ [2004-02-07 13:49:17] nlopess@php.net is this really a doc problem?? ------------------------------------------------------------------------ [2004-02-07 11:15:12] drm at melp dot nl Description: ------------ Apache hangs when callback parameters are defined in an array (obj& obj, string methodName) form. I suggest the documentation type hints are changed from xml_set_*_handler ( resource, callback, ... ) to xml_set_*_handler ( resource, string ...) since the an array ( ... ) notation for callbacks should be correct according to http://nl.php.net/manual/en/language.pseudo-types.php Note that it does the parsing until some point at the end of the XML document. I can't quite reproduce where exactly it hangs, but i think its the cleaning up part of the parser when the parsing is done (the $final of xml_parse must be true to reproduce this) or you could fix the bug, of course :P Reproduce code: --------------- xml_set_element_handler ( $this->parserResource, array ( &$this, 'startElementHandler' ), array ( &$this, 'endElementHandler' ) ); Expected result: ---------------- don't hang apache ;) Actual result: -------------- hangs apache, (99% cpu), probably an endless loop? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27180&edit=1

« previous php.bugs (#54537) next »