note to return arrays from a function use array _ init and all following actions on the predefined variable return _ value given as argument to your exported function see the earlier discussion of the call interface you do not have to use make _ std _ zval on this 