Hi. We are writing an extension for Novell's component infrastructure piece called UCS, which allows one to talk to various component systems. It is modelled on the Java extension written by Sam Ruby.
We have been able to handle the basic datatypes and even objects, but are presently stuck with arrays. When we debug in our code, the array values seem fine; but when they surface in the script (after going thro' the Zend interpreter), we are not able to get the array values. In the script, the line is something like: $arr1[] = method_returning_array(some_parameters); This method call happens thro' the extension, which also handles the data conversion for both ways. As I said earlier, the values are fine in the extension code; but somewhere in between when the array is returned by the method and reaches the script, there is some problem. We assume that we have missed something in my coding. The conversion portion of the code is somewhat like this: void ucs_var_2_php_var(PIUCSVariable ucs_var, zval *php_var) { .... // Array .... array_init(php_var); for (int i = 0; i < ucs_array_size; i++) { .... zval php_element; // Get each element from the UCS array .... // Translate to PHP by calling the same function for each element ucs_var_2_php_var(ucs_element, &php_element); // Put element into array zend_hash_index_update(php_var->value.ht, (int)i, (void*)&php_element, sizeof(zval*), NULL); .... } .... } Could someone help us out by seeing if we're doing something wrong? Thanx in advance, Venkat