From 8c9cdf69d5c511139e55cc068d5c0d7ccaa88571 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Sat, 2 May 2020 19:07:59 +0200 Subject: [PATCH] Use new Fast ZPP macros for string|int parar types --- ext/intl/uchar/uchar.c | 191 +++++++++--------- ext/intl/uchar/uchar.stub.php | 346 ++++++++++----------------------- ext/intl/uchar/uchar_arginfo.h | 20 +- 3 files changed, 203 insertions(+), 354 deletions(-) diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c index e5092f18fd722..b6d566120e9ae 100644 --- a/ext/intl/uchar/uchar.c +++ b/ext/intl/uchar/uchar.c @@ -8,56 +8,53 @@ #define IC_METHOD(mname) PHP_METHOD(IntlChar, mname) -static inline int convert_cp(UChar32* pcp, zval *zcp) { - zend_long cp = -1; - - if (Z_TYPE_P(zcp) == IS_LONG) { - cp = Z_LVAL_P(zcp); - } else if (Z_TYPE_P(zcp) == IS_STRING) { +static inline int convert_cp(UChar32* pcp, zend_string *string_codepoint, zend_long int_codepoint) { + if (string_codepoint != NULL) { int32_t i = 0; - size_t zcp_len = Z_STRLEN_P(zcp); + size_t string_codepoint_length = ZSTR_LEN(string_codepoint); - if (ZEND_SIZE_T_INT_OVFL(zcp_len)) { + if (ZEND_SIZE_T_INT_OVFL(string_codepoint_length)) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); intl_error_set_custom_msg(NULL, "Input string is too long.", 0); return FAILURE; } - U8_NEXT(Z_STRVAL_P(zcp), i, zcp_len, cp); - if ((size_t)i != zcp_len) { + U8_NEXT(ZSTR_VAL(string_codepoint), i, string_codepoint_length, int_codepoint); + if ((size_t)i != string_codepoint_length) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); intl_error_set_custom_msg(NULL, "Passing a UTF-8 character for codepoint requires a string which is exactly one UTF-8 codepoint long.", 0); return FAILURE; } - } else { - intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); - intl_error_set_custom_msg(NULL, "Invalid parameter for unicode point. Must be either integer or UTF-8 sequence.", 0); - return FAILURE; } - if ((cp < UCHAR_MIN_VALUE) || (cp > UCHAR_MAX_VALUE)) { + + if ((int_codepoint < UCHAR_MIN_VALUE) || (int_codepoint > UCHAR_MAX_VALUE)) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); intl_error_set_custom_msg(NULL, "Codepoint out of range", 0); return FAILURE; } - *pcp = (UChar32)cp; + *pcp = (UChar32)int_codepoint; return SUCCESS; } +static zend_never_inline int parse_code_point_param(INTERNAL_FUNCTION_PARAMETERS, UChar32 *cp) { + zend_string *string_codepoint; + zend_long int_codepoint; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + return convert_cp(cp, string_codepoint, int_codepoint); +} + /* {{{ proto string IntlChar::chr(int|string $codepoint) * Converts a numeric codepoint to UTF-8 * Acts as an identify function when given a valid UTF-8 encoded codepoint */ IC_METHOD(chr) { UChar32 cp; - zval *zcp; char buffer[5]; int buffer_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -76,13 +73,8 @@ IC_METHOD(chr) { */ IC_METHOD(ord) { UChar32 cp; - zval *zcp; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -94,13 +86,15 @@ IC_METHOD(ord) { IC_METHOD(hasBinaryProperty) { UChar32 cp; zend_long prop; - zval *zcp; + zend_string *string_codepoint; + zend_long int_codepoint; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &zcp, &prop) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + Z_PARAM_LONG(prop) + ZEND_PARSE_PARAMETERS_END(); - if (convert_cp(&cp, zcp) == FAILURE) { + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { RETURN_NULL(); } @@ -112,13 +106,15 @@ IC_METHOD(hasBinaryProperty) { IC_METHOD(getIntPropertyValue) { UChar32 cp; zend_long prop; - zval *zcp; + zend_string *string_codepoint; + zend_long int_codepoint; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &zcp, &prop) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + Z_PARAM_LONG(prop) + ZEND_PARSE_PARAMETERS_END(); - if (convert_cp(&cp, zcp) == FAILURE) { + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { RETURN_NULL(); } @@ -153,13 +149,8 @@ IC_METHOD(getIntPropertyMaxValue) { /* {{{ proto float IntlChar::getNumericValue(int|string $codepoint) */ IC_METHOD(getNumericValue) { UChar32 cp; - zval *zcp; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -173,8 +164,7 @@ typedef struct _enumCharType_data { zend_fcall_info_cache fci_cache; } enumCharType_data; static UBool enumCharType_callback(enumCharType_data *context, - UChar32 start, UChar32 limit, - UCharCategory type) { + UChar32 start, UChar32 limit, UCharCategory type) { zval retval; zval args[3]; @@ -212,13 +202,8 @@ IC_METHOD(enumCharTypes) { /* {{{ proto int IntlChar::getBlockCode(int|string $codepoint) */ IC_METHOD(getBlockCode) { UChar32 cp; - zval *zcp; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -229,17 +214,20 @@ IC_METHOD(getBlockCode) { /* {{{ proto string IntlChar::charName(int|string $codepoint, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) */ IC_METHOD(charName) { UChar32 cp; - zval *zcp; + zend_string *string_codepoint; + zend_long int_codepoint; UErrorCode error = U_ZERO_ERROR; zend_long nameChoice = U_UNICODE_CHAR_NAME; zend_string *buffer = NULL; int32_t buffer_len; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &zcp, &nameChoice) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(nameChoice) + ZEND_PARSE_PARAMETERS_END(); - if (convert_cp(&cp, zcp) == FAILURE) { + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { RETURN_NULL(); } @@ -279,8 +267,8 @@ typedef struct _enumCharNames_data { zend_fcall_info_cache fci_cache; } enumCharNames_data; static UBool enumCharNames_callback(enumCharNames_data *context, - UChar32 code, UCharNameChoice nameChoice, - const char *name, int32_t length) { + UChar32 code, UCharNameChoice nameChoice, + const char *name, int32_t length) { zval retval; zval args[3]; @@ -306,16 +294,22 @@ static UBool enumCharNames_callback(enumCharNames_data *context, } IC_METHOD(enumCharNames) { UChar32 start, limit; - zval *zstart, *zlimit; + zend_string *string_start, *string_limit; + zend_long int_start, int_limit; enumCharNames_data context; zend_long nameChoice = U_UNICODE_CHAR_NAME; UErrorCode error = U_ZERO_ERROR; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzf|l", &zstart, &zlimit, &context.fci, &context.fci_cache, &nameChoice) == FAILURE) { - RETURN_THROWS(); - } - if (convert_cp(&start, zstart) == FAILURE || convert_cp(&limit, zlimit) == FAILURE) { + ZEND_PARSE_PARAMETERS_START(3, 4) + Z_PARAM_STR_OR_LONG(string_start, int_start) + Z_PARAM_STR_OR_LONG(string_limit, int_limit) + Z_PARAM_FUNC(context.fci, context.fci_cache) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(nameChoice) + ZEND_PARSE_PARAMETERS_END(); + + if (convert_cp(&start, string_start, int_start) == FAILURE || convert_cp(&limit, string_limit, int_limit) == FAILURE) { RETURN_NULL(); } @@ -395,19 +389,21 @@ IC_METHOD(getPropertyValueEnum) { /* {{{ proto int|string IntlChar::foldCase(int|string $codepoint, int $options = IntlChar::FOLD_CASE_DEFAULT) */ IC_METHOD(foldCase) { UChar32 cp, ret; - zval *zcp; zend_long options = U_FOLD_CASE_DEFAULT; + zend_string *string_codepoint; + zend_long int_codepoint; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &zcp, &options) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + Z_PARAM_LONG(options) + ZEND_PARSE_PARAMETERS_END(); - if (convert_cp(&cp, zcp) == FAILURE) { + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { RETURN_NULL(); } ret = u_foldCase(cp, options); - if (Z_TYPE_P(zcp) == IS_STRING) { + if (string_codepoint != NULL) { char buffer[5]; int buffer_len = 0; U8_APPEND_UNSAFE(buffer, buffer_len, ret); @@ -422,15 +418,18 @@ IC_METHOD(foldCase) { /* {{{ proto int IntlChar::digit(int|string $codepoint[, int $radix = 10]) */ IC_METHOD(digit) { UChar32 cp; - zval *zcp; zend_long radix = 10; int ret; + zend_string *string_codepoint; + zend_long int_codepoint; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &zcp, &radix) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(radix) + ZEND_PARSE_PARAMETERS_END(); - if (convert_cp(&cp, zcp) == FAILURE) { + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { RETURN_NULL(); } @@ -459,15 +458,10 @@ IC_METHOD(forDigit) { /* {{{ proto array IntlChar::charAge(int|string $codepoint) */ IC_METHOD(charAge) { UChar32 cp; - zval *zcp; UVersionInfo version; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -499,17 +493,12 @@ IC_METHOD(getUnicodeVersion) { /* {{{ proto string IntlChar::getFC_NFKC_Closure(int|string $codepoint) */ IC_METHOD(getFC_NFKC_Closure) { UChar32 cp; - zval *zcp; UChar *closure; zend_string *u8str; int32_t closure_len; UErrorCode error = U_ZERO_ERROR; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) { - RETURN_THROWS(); - } - - if (convert_cp(&cp, zcp) == FAILURE) { + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { RETURN_NULL(); } @@ -536,9 +525,10 @@ IC_METHOD(getFC_NFKC_Closure) { /* {{{ proto bool IntlChar::(int|string $codepoint) */ #define IC_BOOL_METHOD_CHAR(name) \ IC_METHOD(name) { \ - UChar32 cp; zval *zcp; \ - if ((zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) || \ - (convert_cp(&cp, zcp) == FAILURE)) { return; } \ + UChar32 cp; \ + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { \ + RETURN_NULL(); \ + } \ RETURN_BOOL(u_##name(cp)); \ } IC_BOOL_METHOD_CHAR(isUAlphabetic) @@ -575,9 +565,10 @@ IC_BOOL_METHOD_CHAR(isJavaIDPart) /* {{{ proto int IntlChar::(int|string $codepoint) */ #define IC_INT_METHOD_CHAR(name) \ IC_METHOD(name) { \ - UChar32 cp; zval *zcp; \ - if ((zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) || \ - (convert_cp(&cp, zcp) == FAILURE)) { return; } \ + UChar32 cp; \ + if (parse_code_point_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, &cp) == FAILURE) { \ + RETURN_NULL(); \ + } \ RETURN_LONG(u_##name(cp)); \ } IC_INT_METHOD_CHAR(charDirection) @@ -593,11 +584,17 @@ IC_INT_METHOD_CHAR(charDigitValue) */ #define IC_CHAR_METHOD_CHAR(name) \ IC_METHOD(name) { \ - UChar32 cp, ret; zval *zcp; \ - if ((zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcp) == FAILURE) || \ - (convert_cp(&cp, zcp) == FAILURE)) { return; } \ + UChar32 cp, ret; \ + zend_string *string_codepoint; \ + zend_long int_codepoint; \ + ZEND_PARSE_PARAMETERS_START(1, 1) \ + Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) \ + ZEND_PARSE_PARAMETERS_END(); \ + if (convert_cp(&cp, string_codepoint, int_codepoint) == FAILURE) { \ + RETURN_NULL(); \ + } \ ret = u_##name(cp); \ - if (Z_TYPE_P(zcp) == IS_STRING) { \ + if (string_codepoint != NULL) { \ char buffer[5]; \ int buffer_len = 0; \ U8_APPEND_UNSAFE(buffer, buffer_len, ret); \ diff --git a/ext/intl/uchar/uchar.stub.php b/ext/intl/uchar/uchar.stub.php index 398b153185355..a01552f8c9425 100644 --- a/ext/intl/uchar/uchar.stub.php +++ b/ext/intl/uchar/uchar.stub.php @@ -4,107 +4,64 @@ class IntlChar { - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function hasBinaryProperty($codepoint, int $property) {} + /** @return bool|null */ + public static function hasBinaryProperty(int|string $codepoint, int $property) {} - /** - * @param int|string $codepoint - * @return array|null - */ - public static function charAge($codepoint) {} + /** @return array|null */ + public static function charAge(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return int|null - */ - public static function charDigitValue($codepoint) {} + /** @return int|null */ + public static function charDigitValue(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return int|null + /** @return int|null */ - public static function charDirection($codepoint) {} + public static function charDirection(int|string $codepoint) {} /** @return int|null */ public static function charFromName(string $characterName, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) {} - /** - * @param int|string $codepoint - * @return int|string|null - */ - public static function charMirror($codepoint) {} + /** @return int|string|null */ + public static function charMirror(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return string|null - */ - public static function charName($codepoint, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) {} + /** @return string|null */ + public static function charName(int|string $codepoint, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) {} - /** - * @param int|string $codepoint - * @return int|null - */ - public static function charType($codepoint) {} + /** @return int|null */ + public static function charType(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return string|null - */ - public static function chr($codepoint) {} + /** @return string|null */ + public static function chr(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return int|false|null - */ - public static function digit($codepoint, int $radix = 10) {} + /** @return int|false|null */ + public static function digit(int|string $codepoint, int $radix = 10) {} - /** - * @param int|string $start - * @param int|string $limit - * @return bool|null - */ - public static function enumCharNames($start, $limit, callable $callback, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) {} + /** @return bool|null */ + public static function enumCharNames(int|string $start, int|string $limit, callable $callback, int $nameChoice = IntlChar::UNICODE_CHAR_NAME) {} /** @return void */ public static function enumCharTypes(callable $callback) {} /** - * @param int|string $codepoint * @return int|string|null */ - public static function foldCase($codepoint, int $options = IntlChar::FOLD_CASE_DEFAULT) {} + public static function foldCase(int|string $codepoint, int $options = IntlChar::FOLD_CASE_DEFAULT) {} /** @return int */ public static function forDigit(int $digit, $radix = 10) {} #if U_ICU_VERSION_MAJOR_NUM >= 52 - /** - * @param int|string $codepoint - * @return int|string|null - */ - public static function getBidiPairedBracket($codepoint) {} + /** @return int|string|null */ + public static function getBidiPairedBracket(int|string $codepoint) {} #endif - /** - * @param int|string $codepoint - * @return int|null - */ - public static function getBlockCode($codepoint) {} + /** @return int|null */ + public static function getBlockCode(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return int|null - */ - public static function getCombiningClass($codepoint) {} + /** @return int|null */ + public static function getCombiningClass(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return string|false|null - */ - public static function getFC_NFKC_Closure($codepoint) {} + /** @return string|false|null */ + public static function getFC_NFKC_Closure(int|string $codepoint) {} /** @return int */ public static function getIntPropertyMaxValue(int $property) {} @@ -112,22 +69,13 @@ public static function getIntPropertyMaxValue(int $property) {} /** @return int */ public static function getIntPropertyMinValue(int $property) {} - /** - * @param int|string $codepoint - * @return int|null - */ - public static function getIntPropertyValue($codepoint, int $property) {} + /** @return int|null */ + public static function getIntPropertyValue(int|string $codepoint, int $property) {} - /** - * @param int|string $codepoint - * @return float|null - */ - public static function getNumericValue($codepoint) {} + /** @return float|null */ + public static function getNumericValue(int|string $codepoint) {} - /** - * @param string $alias - * @return int - */ + /** @return int */ public static function getPropertyEnum(string $alias) {} /** @return string|false */ @@ -137,200 +85,104 @@ public static function getPropertyName(int $property, int $nameChoice = IntlChar public static function getPropertyValueEnum(int $property, string $name) {} /** @return string|false */ - public static function getPropertyValueName(int $property, int $value, $nameChoice = IntlChar::LONG_PROPERTY_NAME) {} + public static function getPropertyValueName(int $property, int $value, int $nameChoice = IntlChar::LONG_PROPERTY_NAME) {} /** @return array */ public static function getUnicodeVersion() {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isalnum($codepoint) {} + /** @return bool|null */ + public static function isalnum(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isalpha($codepoint) {} + /** @return bool|null */ + public static function isalpha(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isbase($codepoint) {} + /** @return bool|null */ + public static function isbase(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isblank($codepoint) {} + /** @return bool|null */ + public static function isblank(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function iscntrl($codepoint ) {} + /** @return bool|null */ + public static function iscntrl(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isdefined($codepoint) {} + /** @return bool|null */ + public static function isdefined(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isdigit($codepoint) {} + /** @return bool|null */ + public static function isdigit(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isgraph($codepoint ) {} + /** @return bool|null */ + public static function isgraph(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isIDIgnorable($codepoint) {} + /** @return bool|null */ + public static function isIDIgnorable(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isIDPart($codepoint) {} + /** @return bool|null */ + public static function isIDPart(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isIDStart($codepoint) {} + /** @return bool|null */ + public static function isIDStart(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isISOControl($codepoint) {} + /** @return bool|null */ + public static function isISOControl(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isJavaIDPart($codepoint) {} + /** @return bool|null */ + public static function isJavaIDPart(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isJavaIDStart($codepoint) {} + /** @return bool|null */ + public static function isJavaIDStart(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isJavaSpaceChar($codepoint) {} + /** @return bool|null */ + public static function isJavaSpaceChar(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function islower($codepoint) {} + /** @return bool|null */ + public static function islower(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isMirrored($codepoint) {} + /** @return bool|null */ + public static function isMirrored(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isprint($codepoint) {} + /** @return bool|null */ + public static function isprint(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function ispunct($codepoint) {} + /** @return bool|null */ + public static function ispunct(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isspace($codepoint) {} + /** @return bool|null */ + public static function isspace(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function istitle($codepoint) {} + /** @return bool|null */ + public static function istitle(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isUAlphabetic($codepoint) {} + /** @return bool|null */ + public static function isUAlphabetic(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isULowercase($codepoint) {} + /** @return bool|null */ + public static function isULowercase(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isupper($codepoint) {} + /** @return bool|null */ + public static function isupper(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isUUppercase($codepoint) {} + /** @return bool|null */ + public static function isUUppercase(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isUWhiteSpace($codepoint) {} + /** @return bool|null */ + public static function isUWhiteSpace(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isWhitespace($codepoint) {} + /** @return bool|null */ + public static function isWhitespace(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return bool|null - */ - public static function isxdigit($codepoint) {} + /** @return bool|null */ + public static function isxdigit(int|string $codepoint) {} - /** - * @param int|string $character - * @return int|null - */ - public static function ord($character) {} + /** @return int|null */ + public static function ord(int|string $character) {} - /** - * @param int|string $codepoint - * @return int|string|null - */ - public static function tolower($codepoint) {} + /** @return int|string|null */ + public static function tolower(int|string $codepoint) {} - /** - * @param mixed $codepoint - * @return int|string|null - */ - public static function totitle($codepoint) {} + /** @return int|string|null */ + public static function totitle(int|string $codepoint) {} - /** - * @param int|string $codepoint - * @return int|string|null - */ - public static function toupper($codepoint) {} + /** @return int|string|null */ + public static function toupper(int|string $codepoint) {} } diff --git a/ext/intl/uchar/uchar_arginfo.h b/ext/intl/uchar/uchar_arginfo.h index 51f5d65748f7f..006e14fa24909 100644 --- a/ext/intl/uchar/uchar_arginfo.h +++ b/ext/intl/uchar/uchar_arginfo.h @@ -1,12 +1,12 @@ /* This is a generated file, edit the .stub.php file instead. */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 0, 2) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_charAge, 0, 0, 1) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_charDigitValue arginfo_class_IntlChar_charAge @@ -21,7 +21,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_charMirror arginfo_class_IntlChar_charAge ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_charName, 0, 0, 1) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nameChoice, IS_LONG, 0, "IntlChar::UNICODE_CHAR_NAME") ZEND_END_ARG_INFO() @@ -30,13 +30,13 @@ ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_chr arginfo_class_IntlChar_charAge ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_digit, 0, 0, 1) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, radix, IS_LONG, 0, "10") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_enumCharNames, 0, 0, 3) - ZEND_ARG_INFO(0, start) - ZEND_ARG_INFO(0, limit) + ZEND_ARG_TYPE_MASK(0, start, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, limit, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nameChoice, IS_LONG, 0, "IntlChar::UNICODE_CHAR_NAME") ZEND_END_ARG_INFO() @@ -46,7 +46,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_enumCharTypes, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_foldCase, 0, 0, 1) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "IntlChar::FOLD_CASE_DEFAULT") ZEND_END_ARG_INFO() @@ -57,7 +57,7 @@ ZEND_END_ARG_INFO() #if U_ICU_VERSION_MAJOR_NUM >= 52 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getBidiPairedBracket, 0, 0, 1) - ZEND_ARG_INFO(0, codepoint) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #endif @@ -94,7 +94,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getPropertyValueName, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, nameChoice, "IntlChar::LONG_PROPERTY_NAME") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nameChoice, IS_LONG, 0, "IntlChar::LONG_PROPERTY_NAME") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getUnicodeVersion, 0, 0, 0) @@ -157,7 +157,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_isxdigit arginfo_class_IntlChar_charAge ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_ord, 0, 0, 1) - ZEND_ARG_INFO(0, character) + ZEND_ARG_TYPE_MASK(0, character, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_tolower arginfo_class_IntlChar_charAge