ID: 24644 Comment by: erik at erikcentral dot net Reported By: Bertrand dot Willm at laposte dot net Status: Open Bug Type: XML related Operating System: Windows XP PHP Version: 5.0.0b1 (beta1) New Comment:
<snip> function CreateXMLParser() { $this->parser = xml_parser_create("ISO-8859-1"); $new_ref = $this; xml_set_object($this->parser, $new_ref); xml_set_element_handler($this->parser,array($this,"myOpenElement"),array($this,"myCloseElement")); xml_set_character_data_handler($this->parser,array($this,"myCharData")); } <snip> works on Linux phpV5.0.0b1 Thanks [EMAIL PROTECTED] Previous Comments: ------------------------------------------------------------------------ [2003-07-29 09:12:47] [EMAIL PROTECTED] Just a note to say I've now tested this with sane data and using [EMAIL PROTECTED]'s array. It works fine if you call the base class directly. I moved the $this->privateFunction() call to the EndElement() function to check what's happening; when called via the extended class, the entire thing works except that privateFunction() throws its (expected) error. Basically the xml parser handlers are bypassing the ppp checks. Leaving this bug open as unsure whether this is intended behaviour. ------------------------------------------------------------------------ [2003-07-22 12:52:49] Bertrand dot Willm at laposte dot net There is not difference with or without the &. ------------------------------------------------------------------------ [2003-07-16 02:54:13] [EMAIL PROTECTED] Not good, but anyway please try without & for $this: array($this...) ------------------------------------------------------------------------ [2003-07-16 01:15:11] Bertrand dot Willm at laposte dot net I replace the following line : xml_set_element_handler($parser, 'StartElement', 'EndElement'); with : xml_set_element_handler($parser, array(&$this, 'StartElement'), array(&$this, 'EndElement')); but PHP crashes. ------------------------------------------------------------------------ [2003-07-14 14:26:41] [EMAIL PROTECTED] The only interesting part here is that the error message should say that private method StartElement() was called. The problem is that by the call to xml_parse() the connection to the instance gets lost. you should use array($this,'<method_name>') instead. Try that please. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24644 -- Edit this bug report at http://bugs.php.net/?id=24644&edit=1