On Wed, 23 Oct 2002, Tim Daly, Jr. wrote:
>
> I'm trying to figure out the right way to take an entry from one hash
> table, and put it in another, in C. This is what I first tried:
>
> // naive attempt at
> // $hash2["key"] = $hash1["key"];
>
> zval **val;
>
> zend_hash_find(hash1, "key", strlen("key")+1, (void **)&val);
> SEPARATE_ZVAL(val);
> zval_add_ref(val);
> zend_hash_update(hash2, "key", strlen("key")+1, (void *)val, NULL);
>
>
> That seemed to work. But I started having strange problems in my PHP
> code, like I would assign the property of an object, and later the
> same property would be magically null again. This problem goes away
> when I remove the SEPARATE_ZVAL above.
>
> So, I though maybe one of you kind folks might shed some light on this
> for me.
You don't need to SEPARATE_ZVAL() in this case.
--
Andrei Zmievski Mail: [EMAIL PROTECTED]
Sr. Front End Software Engineer Web: http://www.fast.no/
Fast Search & Transfer Inc Phone: 781-304-2493
93 Worcester Street Fax: 781-304-2410
Wellesley MA 02481-9181, USA Main: 781-304-2400
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php