Skip to content

Commit 9d54609

Browse files
committed
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
2 parents 8c14675 + d4aff25 commit 9d54609

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ static zend_always_inline bool zend_internal_call_should_throw(zend_function *fb
11441144

11451145
static ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc)
11461146
{
1147-
zend_error(E_CORE_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
1147+
zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
11481148
fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
11491149
fbc->common.scope ? "::" : "",
11501150
ZSTR_VAL(fbc->common.function_name));

ext/intl/dateformat/dateformat.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class IntlDateFormatter
88
* @param IntlTimeZone|DateTimeZone|string|null $timezone
99
* @param IntlCalendar|int|null $calendar
1010
*/
11-
public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, string $pattern = "") {}
11+
public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, ?string $pattern = null) {}
1212

1313
/**
1414
* @param IntlTimeZone|DateTimeZone|string|null $timezone
1515
* @return IntlDateFormatter|null
1616
* @alias datefmt_create
1717
*/
18-
public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = "") {}
18+
public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null) {}
1919

2020
/**
2121
* @return int|false

ext/intl/dateformat/dateformat_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4f93c3fca18c225b26dec1e970b783baa4622425 */
2+
* Stub hash: a83ee23ab33293a878280f137260da9f8914218a */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
66
ZEND_ARG_TYPE_INFO(0, dateType, IS_LONG, 0)
77
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
88
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
99
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, calendar, "null")
10-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
10+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
1111
ZEND_END_ARG_INFO()
1212

1313
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)
1616
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
1717
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
1818
ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
19-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
19+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
2020
ZEND_END_ARG_INFO()
2121

2222
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_getDateType, 0, 0, 0)

ext/intl/formatter/formatter.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
class NumberFormatter
66
{
7-
public function __construct(string $locale, int $style, string $pattern = "") {}
7+
public function __construct(string $locale, int $style, ?string $pattern = null) {}
88

99
/**
1010
* @return NumberFormatter|null
1111
* @alias numfmt_create
1212
*/
13-
public static function create(string $locale, int $style, string $pattern = "") {}
13+
public static function create(string $locale, int $style, ?string $pattern = null) {}
1414

1515
/**
1616
* @return string|false

ext/intl/formatter/formatter_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 2a232c97981e23bec14f03e564a7ec3d7fedc31e */
2+
* Stub hash: 4fa61766d54f40d3295da0992b16e08ede9aaab1 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
66
ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0)
7-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
7+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
88
ZEND_END_ARG_INFO()
99

1010
#define arginfo_class_NumberFormatter_create arginfo_class_NumberFormatter___construct

ext/intl/formatter/formatter_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
3434
FORMATTER_METHOD_INIT_VARS;
3535

3636
/* Parse parameters. */
37-
if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s",
37+
if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s!",
3838
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
3939
{
4040
return FAILURE;

ext/intl/php_intl.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function intl_error_name(int $errorCode): string {}
158158
/* dateformat */
159159

160160
/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
161-
function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = ""): ?IntlDateFormatter {}
161+
function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null): ?IntlDateFormatter {}
162162

163163
function datefmt_get_datetype(IntlDateFormatter $formatter): int|false {}
164164

@@ -208,7 +208,7 @@ function datefmt_get_error_message(IntlDateFormatter $formatter): string {}
208208

209209
/* formatter */
210210

211-
function numfmt_create(string $locale, int $style, string $pattern = ""): ?NumberFormatter {}
211+
function numfmt_create(string $locale, int $style, ?string $pattern = null): ?NumberFormatter {}
212212

213213
function numfmt_format(NumberFormatter $formatter, int|float $num, int $type = NumberFormatter::TYPE_DEFAULT): string|false {}
214214

ext/intl/php_intl_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9ddf3e4e42735c34a8b53a1856d6dc93346afc6f */
2+
* Stub hash: 9d6b4d36a39e4bb346ea0d45d4be8c941070bd67 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
55
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
282282
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
283283
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
284284
ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
285-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
285+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
286286
ZEND_END_ARG_INFO()
287287

288288
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()
370370
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_numfmt_create, 0, 2, NumberFormatter, 1)
371371
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
372372
ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0)
373-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
373+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
374374
ZEND_END_ARG_INFO()
375375

376376
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_numfmt_format, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)

0 commit comments

Comments
 (0)