[php-src] master: Zend: remove zend_parse_parameter() (#23051)
Gina Peter Banyard via GitHub <[email protected]>
| Newsgroups | gmane.comp.php.cvs.general |
|---|---|
| Message-ID | <[email protected]> |
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-08-10T18:34:18+01:00
Commit: https://github.com/php/php-src/commit/bad89ea44532fcaa7b8ee02b09c5b35cd14525e0
Raw diff: https://github.com/php/php-src/commit/bad89ea44532fcaa7b8ee02b09c5b35cd14525e0.diff
Zend: remove zend_parse_parameter() (#23051)
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
Changed paths:
M Zend/zend_API.c
M Zend/zend_API.h
Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 7d407f7e9053..d7ed141a3e1d 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 aff9846d21b8..ad224884f360 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);