Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51325 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9596 invoked from network); 19 Jan 2011 19:15:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2011 19:15:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=peter.e.lind@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=peter.e.lind@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: peter.e.lind@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:32885] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/5D-41614-A38373D4 for ; Wed, 19 Jan 2011 14:15:07 -0500 Received: by qwj8 with SMTP id 8so1169012qwj.29 for ; Wed, 19 Jan 2011 11:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=siTuBBtS9z9Dri4xXsoAbJq+KY/G3w5tyAeS3BW25LM=; b=LLdkOvQ31DbdTCx36ZyGohxSNTjl0+9BFkGn7PCDCsIxyVhQfk584y/p0LRTH1m+Wy wxOM88XrjXVmLm9weLK/pEWXWIAXKUqr2H5t97MrTswLH3epv5wpgmKlnJjwPintMvqW 3DxsEo2glFm3hYLyWTzpgWYX/SaUjYTALlbKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=EUb5/XIAjudtBrh0kBX4gapKID6JJYUjj7wZ7WjytRSSz9kMNsqGak1SEmeHdgk0yD ZnvC3CIMrmw7kmuv3f+S0hzm1pUQ0LETpvUDP4JhE+wrb4QOHVNvHp0BNUE1p2n+4feh LI8OO2c2vnpxppDOpCsNRegNndaYVF5sbBLpw= Received: by 10.229.229.83 with SMTP id jh19mr893582qcb.234.1295464504069; Wed, 19 Jan 2011 11:15:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.229.207 with HTTP; Wed, 19 Jan 2011 11:14:43 -0800 (PST) In-Reply-To: <4D3735F3.7020502@garfieldtech.com> References: <201101190045.31781.larry@garfieldtech.com> <4D368C58.2040903@yahoo.com.au> <201101190109.52250.larry@garfieldtech.com> <4D369473.4040608@yahoo.com.au> <4D3735F3.7020502@garfieldtech.com> Date: Wed, 19 Jan 2011 20:14:43 +0100 Message-ID: To: "larry@garfieldtech.com" Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] How deep is copy on write? From: peter.e.lind@gmail.com (Peter Lind) On 19 January 2011 20:05, larry@garfieldtech.com w= rote: > So it sounds like the general answer is that if you pass a complex array = to > a function by value and mess with it, data is duplicated for every item y= ou > modify and its direct ancestors up to the root variable but not for the r= est > of the tree. > > For objects, because of their "pass by handle"-type behavior you are > (usually) modifying the same data directly so there's no duplication. > > Does that sound correct? > > Related: What is the overhead of a ZVal? =C2=A0I'm assuming it's a fixed = number > of bytes. > http://lmgtfy.com/?q=3Dphp+zval&l=3D1 Regards Peter --=20 WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15