Bug #6665 Updated: object variables get 'unset' when assigned within xml handlers

From: Date: Sat, 27 Apr 2002 11:38:28 +0000
Subject: Bug #6665 Updated: object variables get 'unset' when assigned within xml handlers
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5831@lists.php.net to get a copy of this message
ID: 6665 Updated by: cox@php.net Reported By: igor@ipass.net -Status: Open +Status: Bogus -Bug Type: XML related +Bug Type: PEAR related Operating System: Solaris 7 & 8 PHP Version: 4.1.0 New Comment: It's imprescindible to create the object by reference: $o = &new _TestParser1; -- Tomas V.V.Cox Previous Comments: ------------------------------------------------------------------------ [2001-12-13 16:18:10] lobbin@php.net I can reproduce this with PHP 4.1.0/Linux $this->data works if assigned a value in __TestParser1() constructor. ------------------------------------------------------------------------ [2000-09-12 01:06:19] igor@ipass.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 \ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=6665&edit=1

« previous php.pear.dev (#5831) next »