mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
make next() return a single value instead of an array with one element
This commit is contained in:
parent
f7c0bc955c
commit
d041982a9c
2 changed files with 18 additions and 0 deletions
|
@ -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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue