Skip to content

Commit

Permalink
Zend: Remove zend_fcall_info_args_ex()
Browse files Browse the repository at this point in the history
The last usage within php-src was within PDO but this is no longer the case since 3ff7758
Moreover, external usage is very limited and the two usages I could find have been removed. [1][2]

[1] zephir-lang/zephir@82a8d05
[2] krakjoe/uopz@b1015ae
  • Loading branch information
Girgias committed Jan 31, 2025
1 parent b4f275f commit 174ec4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
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
15 changes: 2 additions & 13 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -4360,7 +4360,7 @@ 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;
Expand All @@ -4379,12 +4379,7 @@ 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();
Expand All @@ -4393,12 +4388,6 @@ ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function
}
/* }}} */

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

0 comments on commit 174ec4d

Please sign in to comment.