Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zend: Remove zend_fcall_info_args_ex() #17652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ PHP 8.5 INTERNALS UPGRADE NOTES
a value to a non-reference zval.
. Added zval_ptr_safe_dtor() to safely destroy a zval when a destructor
could interfere.
. The zend_fcall_info_args_ex() API has been removed.
This is because it does not follow the usual CUFA semantics and it
automatically wraps by-value arguments into references for by-ref
parameters.
It is recommended to set the FCI named_params instead,
however zend_fcall_info_args() can also be used.

========================
2. Build system changes
Expand Down
17 changes: 2 additions & 15 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -4360,10 +4360,9 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_
}
/* }}} */

ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args) /* {{{ */
ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args) /* {{{ */
{
zval *arg, *params;
uint32_t n = 1;

zend_fcall_info_args_clear(fci, !args);

Expand All @@ -4379,26 +4378,14 @@ ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function
fci->params = params = (zval *) erealloc(fci->params, fci->param_count * sizeof(zval));

ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(args), arg) {
if (func && !Z_ISREF_P(arg) && ARG_SHOULD_BE_SENT_BY_REF(func, n)) {
ZVAL_NEW_REF(params, arg);
Z_TRY_ADDREF_P(arg);
} else {
ZVAL_COPY(params, arg);
}
ZVAL_COPY(params, arg);
params++;
n++;
} ZEND_HASH_FOREACH_END();

return SUCCESS;
}
/* }}} */

ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args) /* {{{ */
{
return zend_fcall_info_args_ex(fci, NULL, args);
}
/* }}} */

ZEND_API void zend_fcall_info_argp(zend_fcall_info *fci, uint32_t argc, zval *argv) /* {{{ */
{
zend_fcall_info_args_clear(fci, !argc);
Expand Down
1 change: 0 additions & 1 deletion Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_
* refcount. If args is NULL and arguments are set then those are cleared.
*/
ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args);
ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args);

/** Set arguments in the zend_fcall_info struct taking care of refcount.
* If argc is 0 the arguments which are set will be cleared, else pass
Expand Down