Modifying PHP variables in C

[email protected] ("John Lim")
Newsgroups php.dev
Message-ID <[email protected]>
Hi,

I'm porting some PHP code to C, and was hoping that someone can help me.

I have 2 variables $oldarray  and $newarray that both hold arrays and want
to set

  $oldarray = $newarray;

I suppose i have to dispose of $oldarray before i set it to $newarray. I'm
not sure what is the best way, so i did this.

zval **oldarray,*newarray;

zval_add_ref(&newarray);
convert_to_null_ex(oldarray);
*oldarray = newarray;

Would this work? Secondly is there a better way. Thanks again.

John Lim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.