]> granicus.if.org Git - php/commitdiff
change argument parsing
authorXinchen Hui <laruence@gmail.com>
Sat, 17 Feb 2018 14:29:59 +0000 (22:29 +0800)
committerXinchen Hui <laruence@gmail.com>
Sat, 17 Feb 2018 14:29:59 +0000 (22:29 +0800)
ext/standard/string.c

index 0023c4ba3b8f860f73766bf9ee3421a74d49eae0..585495b71556bd2df2a0324b9c67bb58d1d4bfcd 100644 (file)
@@ -2757,14 +2757,13 @@ PHP_FUNCTION(quotemeta)
    Warning: This function is special-cased by zend_compile.c and so is bypassed for constant string argument */
 PHP_FUNCTION(ord)
 {
-       char   *str;
-       size_t str_len;
+       zend_string *str;
 
        ZEND_PARSE_PARAMETERS_START(1, 1)
-               Z_PARAM_STRING(str, str_len)
+               Z_PARAM_STR(str)
        ZEND_PARSE_PARAMETERS_END();
 
-       RETURN_LONG((unsigned char) str[0]);
+       RETURN_LONG((unsigned char) ZSTR_VAL(str)[0]);
 }
 /* }}} */