Bug #11092: (Yet Another) References Weirdness

From: Date: Thu, 24 May 2001 17:04:25 +0000
Subject: Bug #11092: (Yet Another) References Weirdness
Groups: php.dev 
Request: Send a blank email to php-dev+get-56642@lists.php.net to get a copy of this message
From: sbergmann@php.net Operating system: should be OS independent PHP version: 4.0.5 PHP Bug Type: Scripting Engine problem Bug description: (Yet Another) References Weirdness There seems to be a problem with objects returned from class methods by reference: <?php class a { var $data; function add_data($data) { $this->data[] = $data; } } class b { var $a; function &add_a() { $this->a = new a; return $this->a; } function dump() { print_r($this->a->data); } } $b = new b; $a = $b->add_a(); $a->add_data('test'); // works not $b->a->add_data('test'); // works $b->dump(); ?> -- Edit Bug report at: http://bugs.php.net/?id=11092&edit=1

« previous php.dev (#56642) next »