Bug #13476 Updated: probleme when using &$this in a constructor
| From: | yohgaki@php.net | Date: | Fri, 14 Dec 2001 19:07:45 +0000 |
| Subject: | Bug #13476 Updated: probleme when using &$this in a constructor | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73797@lists.php.net to get a copy of this message | ||
ID: 13476
Updated by: yohgaki
Reported By: e.sobole@webshaker.net
Old Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: linux Debian 2.2
PHP Version: 4.0.6
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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