php extension: returning array of arrays

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi there,

it's my 1st week of PHP so forgive me for such a basic question. I'm  
trying to return an array of arrays of strings from a home-made PHP  
extension module. My current code looks like :

   add_next_index_long(return_value, nb_of_arrays);
   for ( ... ) {
    zval *one_array;
    add_next_index_long(one_array, nb_of_strings);
    for (...) {
        add_next_index_string(one_array, string[..],1);
    add_next_index_zval(return_value, one_array);

This causes a failure in Apache.

Before debugging my PHP extension tomorrow morning (e.g. to suppress the  
useless '# of items' in each array ;-), can anybody tell me whether this  
is the proper way to achieve this ?

Thx in advance,

Re: php extension: returning array of arrays

I'm pretty sure you need to call MAKE_STD_ZVAL() on a variable before

Re: php extension: returning array of arrays

Chung Leong a écrit :
Quoted text here. Click to load it

It's *a lot* better. Thanks for the hint.

Site Timeline