From:             [EMAIL PROTECTED]
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:

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() {

$b = new b;
$a = $b->add_a();
$a->add_data('test');    // works not
$b->a->add_data('test'); // works

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to