Skip to content

Commit 655631f

Browse files
committed
ext/intl IntlChar::enumCharNames changes the signature to void.
1 parent b526221 commit 655631f

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ PHP 8.3 UPGRADE NOTES
8181
- Intl:
8282
. datefmt_set_timezone (and its alias IntlDateformatter::setTimeZone)
8383
now returns true on sucess, previously null was returned.
84+
. IntlChar::enumCharNames is now a void method.
85+
Previously it returned null on success and false on failure.
8486

8587
- MBString:
8688
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional

ext/intl/intl_data.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ typedef struct _intl_data {
6161
RETURN_NULL(); \
6262
}
6363

64+
/* Check status by error code, if error return directly */
65+
#define INTL_CHECK_STATUS_RETURN(err, msg) \
66+
intl_error_set_code( NULL, (err) ); \
67+
if( U_FAILURE((err)) ) \
68+
{ \
69+
intl_error_set_custom_msg( NULL, msg, 0 ); \
70+
return; \
71+
}
6472

6573
/* Check status in object, if error return false */
6674
#define INTL_METHOD_CHECK_STATUS(obj, msg) \

ext/intl/uchar/uchar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ IC_METHOD(enumCharNames) {
309309
ZEND_PARSE_PARAMETERS_END();
310310

311311
if (convert_cp(&start, string_start, int_start) == FAILURE || convert_cp(&limit, string_limit, int_limit) == FAILURE) {
312-
RETURN_NULL();
312+
return;
313313
}
314314

315315
u_enumCharNames(start, limit, (UEnumCharNamesFn*)enumCharNames_callback, &context, nameChoice, &error);
316-
INTL_CHECK_STATUS(error, NULL);
316+
INTL_CHECK_STATUS_RETURN(error, NULL);
317317
}
318318
/* }}} */
319319

ext/intl/uchar/uchar.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@ public static function chr(int|string $codepoint): ?string {}
34113411
public static function digit(int|string $codepoint, int $base = 10): int|false|null {}
34123412

34133413
/** @tentative-return-type */
3414-
public static function enumCharNames(int|string $start, int|string $end, callable $callback, int $type = IntlChar::UNICODE_CHAR_NAME): ?bool {} // TODO return values just don't make sense
3414+
public static function enumCharNames(int|string $start, int|string $end, callable $callback, int $type = IntlChar::UNICODE_CHAR_NAME): void {}
34153415

34163416
/** @tentative-return-type */
34173417
public static function enumCharTypes(callable $callback): void {}

ext/intl/uchar/uchar_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)