Skip to content

Commit 3d299d4

Browse files
committed
Remove zend_fcall_info_call() API
The last parameter which is named zval *args, does NOT set the FCI params field. It is expected to be a PHP array which gets looped over to set the arguments which is also a zval pointer... Since PHP 8.0, the named_params field is a more appropriate way of doing this. Also remove zend_fcall_info_args_save() and zend_fcall_info_args_restore() as they were only used in the implementation of zend_fcall_info_call()
1 parent 1492e42 commit 3d299d4

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

Zend/zend_API.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,23 +4136,6 @@ ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, bool free_mem) /*
41364136
}
41374137
/* }}} */
41384138

4139-
ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_count, zval **params) /* {{{ */
4140-
{
4141-
*param_count = fci->param_count;
4142-
*params = fci->params;
4143-
fci->param_count = 0;
4144-
fci->params = NULL;
4145-
}
4146-
/* }}} */
4147-
4148-
ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params) /* {{{ */
4149-
{
4150-
zend_fcall_info_args_clear(fci, 1);
4151-
fci->param_count = param_count;
4152-
fci->params = params;
4153-
}
4154-
/* }}} */
4155-
41564139
ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args) /* {{{ */
41574140
{
41584141
zval *arg, *params;
@@ -4234,29 +4217,6 @@ ZEND_API void zend_fcall_info_argn(zend_fcall_info *fci, uint32_t argc, ...) /*
42344217
}
42354218
/* }}} */
42364219

4237-
ZEND_API zend_result zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval_ptr, zval *args) /* {{{ */
4238-
{
4239-
zval retval, *org_params = NULL;
4240-
uint32_t org_count = 0;
4241-
zend_result result;
4242-
4243-
fci->retval = retval_ptr ? retval_ptr : &retval;
4244-
if (args) {
4245-
zend_fcall_info_args_save(fci, &org_count, &org_params);
4246-
zend_fcall_info_args(fci, args);
4247-
}
4248-
result = zend_call_function(fci, fcc);
4249-
4250-
if (!retval_ptr && Z_TYPE(retval) != IS_UNDEF) {
4251-
zval_ptr_dtor(&retval);
4252-
}
4253-
if (args) {
4254-
zend_fcall_info_args_restore(fci, org_count, org_params);
4255-
}
4256-
return result;
4257-
}
4258-
/* }}} */
4259-
42604220
ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc, zval *callable)
42614221
{
42624222
if (fcc->closure) {

Zend/zend_API.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -701,15 +701,6 @@ ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags,
701701
*/
702702
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, bool free_mem);
703703

704-
/** Save current arguments from zend_fcall_info *fci
705-
* params array will be set to NULL
706-
*/
707-
ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_count, zval **params);
708-
709-
/** Free arguments connected with zend_fcall_info *fci and set back saved ones.
710-
*/
711-
ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params);
712-
713704
/** Set or clear the arguments in the zend_call_info struct taking care of
714705
* refcount. If args is NULL and arguments are set then those are cleared.
715706
*/
@@ -734,11 +725,6 @@ ZEND_API void zend_fcall_info_argv(zend_fcall_info *fci, uint32_t argc, va_list
734725
*/
735726
ZEND_API void zend_fcall_info_argn(zend_fcall_info *fci, uint32_t argc, ...);
736727

737-
/** Call a function using information created by zend_fcall_info_init()/args().
738-
* If args is given then those replace the argument info in fci is temporarily.
739-
*/
740-
ZEND_API zend_result zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval, zval *args);
741-
742728
/* Zend FCC API to store and handle PHP userland functions */
743729
static zend_always_inline bool zend_fcc_equals(const zend_fcall_info_cache* a, const zend_fcall_info_cache* b)
744730
{

0 commit comments

Comments
 (0)