php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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() {
  $this->XML_Parser();
    }
    function startHandler($xp, $element, $attribs) {
    }
    function endHandler($xp, $element) {
    }
    function cdataHandler($xp, $cdata) {
      $this->data=$cdata;
    }
    function defaultHandler($xp, $cdata) {
 
    }
}
$o = new __TestParser1();
$o->parseString("<?xml version='1.0' ?><root>foo</root>",
1);
echo $o->data;  // Should print 'foo', it does not print anything

?>

No php.ini used

EXTRA_LDFLAGS="-Wl,-s" \
CPPFLAGS=$CFLAGS \
./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 \

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-15 08:46 UTC] thies@php.net
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!
see:
http://viewcvs.php.net/viewcvs.cgi/php4/NEWS.diff?r1=1.532.2.2&r2=1.532.2.3



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