This too:

class A
{
    var $a = array();

    public function &getA()
    {
        return $this->a;
    }
}

$A = new A;
$A->a = array(1);
$array = &$A->getA();
$clone = clone $A;
$clone->a = array();

print_r($A);

On 15 Feb 2004, at 9:14 PM, Herr Witten wrote:

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.

-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to