Hi!

> I use add_assoc_string() when the argument is string,and it works
fine,but when the argument is a array,and i use
> add_assoc_zval(),the result is not what i want.

It would be useful to describe here what "not what I want" looks like.

> here is my code:
>                 if(Z_TYPE_P(value) == IS_STRING){
>                       add_assoc_string(config, key, Z_STRVAL_P(value), 1);
>                       RETURN_ZVAL(config, 1, 0);
>                       return;
>               }else if(Z_TYPE_P(value) == IS_ARRAY){
>                       add_assoc_zval(config, key, value);
>                       RETURN_ZVAL(config, 1, 0);
>                       return;
>               }
> 
> what could the problem be?

For one, value's refcount should be bumped if you are keeping it,
otherwise the engine doesn't know there's another use of this zval.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to