Skip to content

Commit 2da2997

Browse files
committed
ext/intl IntlChar::enumCharNames changes the signature to void.
Close phpGH-10904
1 parent dfae7f9 commit 2da2997

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ PHP NEWS
5656
. Updated datefmt_set_timezone/IntlDateformatter::setTimezone returns type.
5757
(David Carlier).
5858
. Updated IntlBreakInterator::setText return type. (David Carlier)
59+
. Updated IntlChar::enumCharNames return type. (David Carlier)
5960

6061
- JSON:
6162
. Added json_validate(). (Juan Morales)

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ PHP 8.3 UPGRADE NOTES
8787
now returns true on success, previously null was returned.
8888
. IntlBreakiterator::setText() now returns false on failure, previously
8989
null was returned.
90+
now returns true on sucess, previously null was returned.
91+
. IntlChar::enumCharNames is now returning a boolean.
92+
Previously it returned null on success and false on failure.
9093

9194
- MBString:
9295
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional

ext/intl/uchar/uchar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,12 @@ 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_FALSE;
313313
}
314314

315315
u_enumCharNames(start, limit, (UEnumCharNamesFn*)enumCharNames_callback, &context, nameChoice, &error);
316316
INTL_CHECK_STATUS(error, NULL);
317+
RETURN_TRUE;
317318
}
318319
/* }}} */
319320

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): bool {}
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)