|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7186 class object variables get 'unset' when assigned within xml handlers
Submitted: 2000-10-13 11:49 UTC Modified: 2001-02-15 08:46 UTC
From: igo at ipass dot net Assigned:
Status: Closed Package: XML related
PHP Version: 4.0.3 OS: Solaris 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: igo at ipass dot net
New email:
PHP Version: OS:


 [2000-10-13 11:49 UTC] igo at ipass dot net

require_once "XML/Parser.php";

class __TestParser1 extends XML_Parser {
  var $data;
    function __TestParser1() {
    function startHandler($xp, $element, $attribs) {
    function endHandler($xp, $element) {
    function cdataHandler($xp, $cdata) {
    function defaultHandler($xp, $cdata) {
$o = new __TestParser1();
$o->parseString("<?xml version='1.0' ?><root>foo</root>",
echo $o->data;  // Should print 'foo', it does not print anything


No php.ini used

./configure \
--with-regex=system \
--enable-shared     \
--enable-track-vars \
--with-config-file-path=/usr/local/etc \
--with-mysql=/usr/local \
--enable-ftp \
--enable-xml \
--with-gd=no \
--with-db2=no \
--with-db3=no \
--with-zlib=no \


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-15 08:46 UTC]
one bug has been fixed in regards to xml_set_object in CVS

you also need to say:
$o = &new __TestParser1();
instead of 
$o = new __TestParser1();

elsewise $this in the constructor won't be the same as vale of $o once new __TestParser1() has returned!

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Dec 03 07:03:34 2021 UTC