Skip to content

Commit 174ec4d

Browse files
committed
Zend: Remove zend_fcall_info_args_ex()
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
1 parent b4f275f commit 174ec4d

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

UPGRADING.INTERNALS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ PHP 8.5 INTERNALS UPGRADE NOTES
1919
a value to a non-reference zval.
2020
. Added zval_ptr_safe_dtor() to safely destroy a zval when a destructor
2121
could interfere.
22+
. The zend_fcall_info_args_ex() API has been removed.
23+
This is because it does not follow the usual CUFA semantics and it
24+
automatically wraps by-value arguments into references for by-ref
25+
parameters.
26+
It is recommended to set the FCI named_params instead,
27+
however zend_fcall_info_args() can also be used.
2228

2329
========================
2430
2. Build system changes

Zend/zend_API.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4360,7 +4360,7 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_
43604360
}
43614361
/* }}} */
43624362

4363-
ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args) /* {{{ */
4363+
ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args) /* {{{ */
43644364
{
43654365
zval *arg, *params;
43664366
uint32_t n = 1;
@@ -4379,12 +4379,7 @@ ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function
43794379
fci->params = params = (zval *) erealloc(fci->params, fci->param_count * sizeof(zval));
43804380

43814381
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(args), arg) {
4382-
if (func && !Z_ISREF_P(arg) && ARG_SHOULD_BE_SENT_BY_REF(func, n)) {
4383-
ZVAL_NEW_REF(params, arg);
4384-
Z_TRY_ADDREF_P(arg);
4385-
} else {
4386-
ZVAL_COPY(params, arg);
4387-
}
4382+
ZVAL_COPY(params, arg);
43884383
params++;
43894384
n++;
43904385
} ZEND_HASH_FOREACH_END();
@@ -4393,12 +4388,6 @@ ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function
43934388
}
43944389
/* }}} */
43954390

4396-
ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args) /* {{{ */
4397-
{
4398-
return zend_fcall_info_args_ex(fci, NULL, args);
4399-
}
4400-
/* }}} */
4401-
44024391
ZEND_API void zend_fcall_info_argp(zend_fcall_info *fci, uint32_t argc, zval *argv) /* {{{ */
44034392
{
44044393
zend_fcall_info_args_clear(fci, !argc);

Zend/zend_API.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,6 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_
721721
* refcount. If args is NULL and arguments are set then those are cleared.
722722
*/
723723
ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args);
724-
ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args);
725724

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

0 commit comments

Comments
 (0)