diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index d7a63e93b3dcd..a0541de5de136 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -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 diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 90bb9370e1fdd..5659e32a21be4 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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); @@ -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); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 6aeffce25d8e5..b56485981a0fa 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -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