Skip to content

Commit bad89ea

Browse files
authored
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] php-ds/ext-ds#232 [3] https://github.com/libvips/php-vips-ext [4] https://github.com/arnaud-lb/php-go
1 parent e95647c commit bad89ea

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

Zend/zend_API.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,18 +1129,6 @@ static zend_result zend_parse_arg(uint32_t arg_num, zval *arg, va_list *va, cons
11291129
}
11301130
/* }}} */
11311131

1132-
ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg, const char *spec, ...)
1133-
{
1134-
va_list va;
1135-
zend_result ret;
1136-
1137-
va_start(va, spec);
1138-
ret = zend_parse_arg(arg_num, arg, &va, &spec, flags);
1139-
va_end(va);
1140-
1141-
return ret;
1142-
}
1143-
11441132
static ZEND_COLD void zend_parse_parameters_debug_error(const char *msg) {
11451133
const zend_function *active_function = EG(current_execute_data)->func;
11461134
const char *class_name = active_function->common.scope

Zend/zend_API.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg);
373373
ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec, ...);
374374
ZEND_API zend_result zend_parse_method_parameters_ex(int flags, uint32_t num_args, zval *this_ptr, const char *type_spec, ...);
375375

376-
ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg, const char *spec, ...);
377-
378376
/* End of parameter parsing API -- andrei */
379377

380378
ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type);

0 commit comments

Comments
 (0)