From 46eec54d427a0a642db02fee4b2fe7100df2e208 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 4 Aug 2026 21:34:42 +0100 Subject: [PATCH] Zend: remove zend_parse_parameter() This API is far worse than just using the existing zend_parse_arg_TYPE() APIs. A SourceGraph search [1] shows this API is effectively only used by ext/ds to which a PR migrating away from this API has been submitted. [2] The other two usages are from a now deprecated extension [3] and @arnauld-lb's now longer maintained php-go project. [4] As such we think it is reasonable to remove said API. [1] https://sourcegraph.com/search?q=context:global+-f:zend_API.c+-f:zend_API.h+zend_parse_parameter%28&patternType=keyword&sm=0 [2] https://github.com/php-ds/ext-ds/pull/232 [3] https://github.com/libvips/php-vips-ext [4] https://github.com/arnaud-lb/php-go --- Zend/zend_API.c | 12 ------------ Zend/zend_API.h | 2 -- 2 files changed, 14 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index de3570c5e848..93c0676c7785 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1129,18 +1129,6 @@ static zend_result zend_parse_arg(uint32_t arg_num, zval *arg, va_list *va, cons } /* }}} */ -ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg, const char *spec, ...) -{ - va_list va; - zend_result ret; - - va_start(va, spec); - ret = zend_parse_arg(arg_num, arg, &va, &spec, flags); - va_end(va); - - return ret; -} - static ZEND_COLD void zend_parse_parameters_debug_error(const char *msg) { const zend_function *active_function = EG(current_execute_data)->func; const char *class_name = active_function->common.scope diff --git a/Zend/zend_API.h b/Zend/zend_API.h index a3e4e1690d6c..f39be568b42c 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -373,8 +373,6 @@ ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg); ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec, ...); ZEND_API zend_result zend_parse_method_parameters_ex(int flags, uint32_t num_args, zval *this_ptr, const char *type_spec, ...); -ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg, const char *spec, ...); - /* End of parameter parsing API -- andrei */ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type);