From: Harald Radi Date: Tue, 14 Aug 2001 00:28:54 +0000 (+0000) Subject: make next() return a single value instead of an array with one element X-Git-Tag: php-4.0.7RC1~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d041982a9cf997be970d65b3955ad7895dc0c44f;p=php make next() return a single value instead of an array with one element --- diff --git a/ext/com/COM.c b/ext/com/COM.c index 0063f426b1..aeae84ddcf 100644 --- a/ext/com/COM.c +++ b/ext/com/COM.c @@ -741,6 +741,15 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** } } + /* return a single element if next() was called without count */ + if((arg_count == 0) && (count == 1)) + { + long index[] = {1}; + + SafeArrayGetElement(pSA, index, var_result); + SafeArrayDestroy(pSA); + } + return SUCCESS; } else if(C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "reset")) diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c index 0063f426b1..aeae84ddcf 100644 --- a/ext/rpc/com/com_wrapper.c +++ b/ext/rpc/com/com_wrapper.c @@ -741,6 +741,15 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** } } + /* return a single element if next() was called without count */ + if((arg_count == 0) && (count == 1)) + { + long index[] = {1}; + + SafeArrayGetElement(pSA, index, var_result); + SafeArrayDestroy(pSA); + } + return SUCCESS; } else if(C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "reset"))