Re: clone wars
| From: | Herr Witten | Date: | Mon, 16 Feb 2004 02:14:16 +0000 |
| Subject: | Re: clone wars | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7860@lists.php.net to get a copy of this message | ||
Here, I have reproduced the problem:
class A
{
var $a = array();
public function makeAReference()
{
$array = $this->getA();
}
public function &getA()
{
return $this->a;
}
}
$A = new A;
$A->a = array(1);
$A->makeAReference();
$clone = clone $A;
$clone->a = array();
print_r($A);
Try it with an without $A->makeAReference()
I sent in a report. Thanks.
On 15 Feb 2004, at 8:04 PM, Marcus Boerger wrote:
Ok, so you are sure var_dump() doesn't show the & for the property in question? If so i would need to know where exactly the array comes from. And the best way to proceed tehn is to create a bug report with a short reproducing script.