Skip to content

Commit c75c08c

Browse files
committed
Replace zend_parse_parameters() with ZEND_PARSE_PARAMETERS macros
1 parent 4188c3e commit c75c08c

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

ext/filter/filter.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,10 @@ PHP_FUNCTION(filter_has_var)
470470
zend_string *var;
471471
zval *array_ptr = NULL;
472472

473-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS", &arg, &var) == FAILURE) {
474-
RETURN_THROWS();
475-
}
473+
ZEND_PARSE_PARAMETERS_START(2, 2)
474+
Z_PARAM_LONG(arg)
475+
Z_PARAM_STR(var)
476+
ZEND_PARSE_PARAMETERS_END();
476477

477478
array_ptr = php_filter_get_storage(arg);
478479
if (EG(exception)) {
@@ -829,9 +830,7 @@ PHP_FUNCTION(filter_list)
829830
{
830831
int size = sizeof(filter_list) / sizeof(filter_list_entry);
831832

832-
if (zend_parse_parameters_none() == FAILURE) {
833-
RETURN_THROWS();
834-
}
833+
ZEND_PARSE_PARAMETERS_NONE();
835834

836835
array_init(return_value);
837836
for (int i = 0; i < size; ++i) {
@@ -847,9 +846,9 @@ PHP_FUNCTION(filter_id)
847846
int size = sizeof(filter_list) / sizeof(filter_list_entry);
848847
char *filter;
849848

850-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filter, &filter_len) == FAILURE) {
851-
RETURN_THROWS();
852-
}
849+
ZEND_PARSE_PARAMETERS_START(1, 1)
850+
Z_PARAM_STRING(filter, filter_len)
851+
ZEND_PARSE_PARAMETERS_END();
853852

854853
for (int i = 0; i < size; ++i) {
855854
if (strcmp(filter_list[i].name, filter) == 0) {

0 commit comments

Comments
 (0)