Re: How deep is copy on write?
| From: | Peter Lind | Date: | Wed, 19 Jan 2011 19:14:43 +0000 |
| Subject: | Re: How deep is copy on write? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51325@lists.php.net to get a copy of this message | ||
On 19 January 2011 20:05, larry@garfieldtech.com <larry@garfieldtech.com> wrote:
> 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 you
> modify and its direct ancestors up to the root variable but not for the rest
> 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? I'm assuming it's a fixed number
> of bytes.
>
http://lmgtfy.com/?q=php+zval&l=1
Regards
Peter
--
<hype>
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15
</hype>