Due the amount of people asking and filling bugs report on this issue I would like to recommend this patch for the documentation of this function.
Thanks, Tomas V.V.Cox
--- xml-set-object.xml Mon Jun 24 14:28:59 2002 +++ xml-set-object.xml.new Mon Jun 24 14:31:03 2002 @@ -11,7 +11,7 @@ <methodsynopsis> <type>void</type><methodname>xml_set_object</methodname> <methodparam><type>resource</type><parameter>parser</parameter></methodparam> - <methodparam><type>object</type><parameter>&object</parameter></methodparam> + <methodparam><type>object</type><parameter>object</parameter></methodparam> </methodsynopsis> <para> This function allows to use <parameter>parser</parameter> inside @@ -29,7 +29,7 @@ { $this->parser = xml_parser_create(); - xml_set_object($this->parser, &$this); + xml_set_object($this->parser, $this); xml_set_element_handler($this->parser, "tag_open", "tag_close"); xml_set_character_data_handler($this->parser, "cdata"); } @@ -56,7 +56,8 @@ } // end of class xml -$xml_parser = new xml(); +// NOTE! The object should be created by reference +$xml_parser = &new xml(); $xml_parser->parse("<A ID='hallo'>PHP</A>"); ?> ]]>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php