#13476 [Sus->Bgs]: probleme when using &$this in a constructor

From: Date: Sat, 07 Dec 2002 01:32:19 +0000
Subject: #13476 [Sus->Bgs]: probleme when using &$this in a constructor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-26914@lists.php.net to get a copy of this message
ID: 13476 Updated by: sniper@php.net Reported By: e.sobole@webshaker.net -Status: Suspended +Status: Bogus Bug Type: Scripting Engine problem Operating System: linux Debian 2.2 PHP Version: 4.0.6 New Comment: not a bug -> bogus. Previous Comments: ------------------------------------------------------------------------ [2001-12-14 14:08:16] yohgaki@php.net Let's set to Suspended. ------------------------------------------------------------------------ [2001-12-14 14:07:45] yohgaki@php.net To me, it is explained in document at least now. Although it may not be a clear for everyone. This is known issue for a long time. ------------------------------------------------------------------------ [2001-09-28 06:16:25] e.sobole@webshaker.net When I'm triing to use a reference on $this into the constructor of a object, it's a copy of the reference which is passed. have a look to this sample. class A { var $value; var $pB; function A() { $this->Value = 100; } } class B { var $value; function B(&$aa) { $this->value = 200; $aa->pB = &$this; } } $aa = new A(); $bb = new B($aa); $bb->value = 50; echo var_dump($aa); there is no 50 in the représentation of the var_dump function. I've looked in the doc if this limitation is spécified, but NO! Etienne ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=13476&edit=1

« previous php.bugs (#26914) next »