diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-09 14:37:41 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-09 14:37:41 +0100 |
commit | 9d54609a1907094643c6d26fe375058359f1b97e (patch) | |
tree | 2aaf2a4417c7b78568189bbd2ed1d34888695b28 /ext | |
parent | 8c1467521739372b0ffd852311ba979a66a855b0 (diff) | |
parent | d4aff2547333dbe99b54f84b5d9daa93ec27f245 (diff) | |
download | php-git-9d54609a1907094643c6d26fe375058359f1b97e.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Use E_ERROR to report arginfo/zpp mismatch
Make NumberFormatter ctor $pattern nullable
Make IntlDateFormatter ctor $pattern nullable
Diffstat (limited to 'ext')
-rw-r--r-- | ext/intl/dateformat/dateformat.stub.php | 4 | ||||
-rw-r--r-- | ext/intl/dateformat/dateformat_arginfo.h | 6 | ||||
-rw-r--r-- | ext/intl/formatter/formatter.stub.php | 4 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_arginfo.h | 4 | ||||
-rw-r--r-- | ext/intl/formatter/formatter_main.c | 2 | ||||
-rw-r--r-- | ext/intl/php_intl.stub.php | 4 | ||||
-rw-r--r-- | ext/intl/php_intl_arginfo.h | 6 |
7 files changed, 15 insertions, 15 deletions
diff --git a/ext/intl/dateformat/dateformat.stub.php b/ext/intl/dateformat/dateformat.stub.php index 7ffaa1fe5e..7b7043cebd 100644 --- a/ext/intl/dateformat/dateformat.stub.php +++ b/ext/intl/dateformat/dateformat.stub.php @@ -8,14 +8,14 @@ class IntlDateFormatter * @param IntlTimeZone|DateTimeZone|string|null $timezone * @param IntlCalendar|int|null $calendar */ - public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, string $pattern = "") {} + public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, ?string $pattern = null) {} /** * @param IntlTimeZone|DateTimeZone|string|null $timezone * @return IntlDateFormatter|null * @alias datefmt_create */ - public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = "") {} + public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null) {} /** * @return int|false diff --git a/ext/intl/dateformat/dateformat_arginfo.h b/ext/intl/dateformat/dateformat_arginfo.h index 65db5ecb95..dd309dd34c 100644 --- a/ext/intl/dateformat/dateformat_arginfo.h +++ b/ext/intl/dateformat/dateformat_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4f93c3fca18c225b26dec1e970b783baa4622425 */ + * Stub hash: a83ee23ab33293a878280f137260da9f8914218a */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1) @@ -7,7 +7,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, calendar, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_create, 0, 0, 3) @@ -16,7 +16,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_create, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_getDateType, 0, 0, 0) diff --git a/ext/intl/formatter/formatter.stub.php b/ext/intl/formatter/formatter.stub.php index 8118b19d47..a16ad53518 100644 --- a/ext/intl/formatter/formatter.stub.php +++ b/ext/intl/formatter/formatter.stub.php @@ -4,13 +4,13 @@ class NumberFormatter { - public function __construct(string $locale, int $style, string $pattern = "") {} + public function __construct(string $locale, int $style, ?string $pattern = null) {} /** * @return NumberFormatter|null * @alias numfmt_create */ - public static function create(string $locale, int $style, string $pattern = "") {} + public static function create(string $locale, int $style, ?string $pattern = null) {} /** * @return string|false diff --git a/ext/intl/formatter/formatter_arginfo.h b/ext/intl/formatter/formatter_arginfo.h index c30f2ad215..256ba0773a 100644 --- a/ext/intl/formatter/formatter_arginfo.h +++ b/ext/intl/formatter/formatter_arginfo.h @@ -1,10 +1,10 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2a232c97981e23bec14f03e564a7ec3d7fedc31e */ + * Stub hash: 4fa61766d54f40d3295da0992b16e08ede9aaab1 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #define arginfo_class_NumberFormatter_create arginfo_class_NumberFormatter___construct diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 8f44f33fa3..aacae86ca6 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -34,7 +34,7 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s!", &locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE ) { return FAILURE; diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php index 70bb606da4..8b309b2e4b 100644 --- a/ext/intl/php_intl.stub.php +++ b/ext/intl/php_intl.stub.php @@ -158,7 +158,7 @@ function intl_error_name(int $errorCode): string {} /* dateformat */ /** @param IntlTimeZone|DateTimeZone|string|null $timezone */ -function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = ""): ?IntlDateFormatter {} +function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null): ?IntlDateFormatter {} function datefmt_get_datetype(IntlDateFormatter $formatter): int|false {} @@ -208,7 +208,7 @@ function datefmt_get_error_message(IntlDateFormatter $formatter): string {} /* formatter */ -function numfmt_create(string $locale, int $style, string $pattern = ""): ?NumberFormatter {} +function numfmt_create(string $locale, int $style, ?string $pattern = null): ?NumberFormatter {} function numfmt_format(NumberFormatter $formatter, int|float $num, int $type = NumberFormatter::TYPE_DEFAULT): string|false {} diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h index 6d52b53b57..fc734d594e 100644 --- a/ext/intl/php_intl_arginfo.h +++ b/ext/intl/php_intl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9ddf3e4e42735c34a8b53a1856d6dc93346afc6f */ + * Stub hash: 9d6b4d36a39e4bb346ea0d45d4be8c941070bd67 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") @@ -282,7 +282,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_datefmt_create, 0, 3, IntlDateFor ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_get_datetype, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) @@ -370,7 +370,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_numfmt_create, 0, 2, NumberFormatter, 1) ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_numfmt_format, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) |