Re: zval_copy_ctor

From: Date: Sat, 12 May 2001 10:17:12 +0000
Subject: Re: zval_copy_ctor
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-54993@lists.php.net to get a copy of this message
On 2001-05-12 04:29:19, "Jason Greene" <jason@inetgurus.net> wrote: > zval_copy_ctor used on an array makes a reference copy of the array. > Basically, it just copies all the data items in the hashtable and then adds one to the > reference count for all data items. > > Looking at the code, it appears to not recursively copy into nested arrays. > (Could be part of your problem) > Since this is a reference copy, you can not free the memory used by > the array you are copying. I am assuming that this is the cause of your default. Strange stuff. Is there a nice handy API to copy the array completely? I switched to zval_copy_ctor from a manually maintained hash table and copying loop for readability; it's a shame to have to switch back. I'll dig a bit more; I've just thought of another piece of code that might be the culprit... --Wez.

« previous php.dev (#54993) next »