Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7854 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24611 invoked by uid 1010); 16 Feb 2004 00:35:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24510 invoked from network); 16 Feb 2004 00:35:09 -0000 Received: from unknown (HELO imf24aec.mail.bellsouth.net) (205.152.59.72) by pb1.pair.com with SMTP; 16 Feb 2004 00:35:09 -0000 Received: from [192.168.1.109] ([68.18.73.208]) by imf24aec.mail.bellsouth.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040216003508.RKTV4980.imf24aec.mail.bellsouth.net@[192.168.1.109]> for ; Sun, 15 Feb 2004 19:35:08 -0500 Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: <6428860843.20040215234759@marcus-boerger.de> References: <6428860843.20040215234759@marcus-boerger.de> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Date: Sun, 15 Feb 2004 19:35:07 -0500 To: PHP Development X-Mailer: Apple Mail (2.612) Subject: Re: [PHP-DEV] clone wars From: lingwitt@bellsouth.net (Herr Witten) It appears that only one of the variables, an array, is being shared across these multiple objects, but other array variables are not. Moreover, When I make a clone and then set the clone to null, all clones made thereafter are correct. $clone = clone $object; $clone = null; Also, I can't replicate the problem with another class. It only seems to be this class. On 15 Feb 2004, at 5:47 PM, Marcus Boerger wrote: > Hello, > > most probably that property is a reference in which case the result is > correct. > > Sunday, February 15, 2004, 11:45:56 PM, you wrote: > >> It appears that cloning is broken, since a modification to the clone >> modifies the original. For my __clone method implementation, I allow >> all of the variables to be set by default except for one. But this >> problem persists even when I don't modify that one variable. > > > > > -- > Best regards, > Marcus mailto:helly@php.net >