]> granicus.if.org Git - php/commitdiff
Use new param API in tokenizer
authorSara Golemon <pollita@php.net>
Sat, 31 Dec 2016 16:56:15 +0000 (08:56 -0800)
committerSara Golemon <pollita@php.net>
Sat, 31 Dec 2016 17:01:20 +0000 (09:01 -0800)
ext/tokenizer/tokenizer.c

index 9537e912511556216d0166e3139d72752fa8a808..11c82654b4b25a6ca3fddd3f7e52994b35727283 100644 (file)
@@ -275,9 +275,11 @@ PHP_FUNCTION(token_get_all)
        zend_long flags = 0;
        zend_bool success;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &source, &flags) == FAILURE) {
-               return;
-       }
+       ZEND_PARSE_PARAMETERS_START(1, 2)
+               Z_PARAM_STR(source)
+               Z_PARAM_OPTIONAL
+               Z_PARAM_LONG(flags)
+       ZEND_PARSE_PARAMETERS_END();
 
        if (flags & TOKEN_PARSE) {
                success = tokenize_parse(return_value, source);
@@ -297,9 +299,9 @@ PHP_FUNCTION(token_name)
 {
        zend_long type;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
-               return;
-       }
+       ZEND_PARSE_PARAMETERS_START(1, 1)
+               Z_PARAM_LONG(type)
+       ZEND_PARSE_PARAMETERS_END();
 
        RETVAL_STRING(get_token_type_name(type));
 }