Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74588 invoked by uid 1010); 16 Feb 2004 04:57:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74501 invoked from network); 16 Feb 2004 04:57:13 -0000 Received: from unknown (HELO imf19aec.mail.bellsouth.net) (205.152.59.67) by pb1.pair.com with SMTP; 16 Feb 2004 04:57:13 -0000 Received: from [192.168.1.109] ([68.18.73.208]) by imf19aec.mail.bellsouth.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040216045713.KGCO1703.imf19aec.mail.bellsouth.net@[192.168.1.109]> for ; Sun, 15 Feb 2004 23:57:13 -0500 Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: References: <6428860843.20040215234759@marcus-boerger.de> <9D7B9586-6018-11D8-8178-000393030CE6@bellsouth.net> <1435934703.20040216014553@marcus-boerger.de> <82437074406.20040216020453@marcus-boerger.de> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <94CF0EA8-603C-11D8-8BF5-000393030CE6@bellsouth.net> Content-Transfer-Encoding: 7bit Date: Sun, 15 Feb 2004 23:57:11 -0500 To: PHP Development X-Mailer: Apple Mail (2.612) Subject: Re: [PHP-DEV] clone wars From: lingwitt@bellsouth.net (Herr Witten) 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.