Skip to content

Commit 4aa137c

Browse files
committed
Fix the default value of the $length parameter of grapheme_substr()
1 parent ce3b49a commit 4aa137c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/intl/php_intl.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function grapheme_strrpos(string $haystack, string $needle, int $offset = 0): in
245245

246246
function grapheme_strripos(string $haystack, string $needle, int $offset = 0): int|false {}
247247

248-
function grapheme_substr(string $string, int $start, ?int $length = 0): string|false {}
248+
function grapheme_substr(string $string, int $start, ?int $length = null): string|false {}
249249

250250
function grapheme_strstr(string $haystack, string $needle, bool $before_needle = false): string|false {}
251251

ext/intl/php_intl_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ ZEND_END_ARG_INFO()
463463
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_substr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
464464
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
465465
ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0)
466-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "0")
466+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
467467
ZEND_END_ARG_INFO()
468468

469469
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_strstr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)

0 commit comments

Comments
 (0)