Skip to content

Commit 4988e9a

Browse files
committed
Fix signatures
1 parent 8f2e544 commit 4988e9a

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

ext/intl/grapheme/grapheme_string.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ PHP_FUNCTION(grapheme_strpos)
8484
char *haystack, *needle;
8585
size_t haystack_len, needle_len;
8686
const char *found;
87-
char *locale = "";
8887
zend_long loffset = 0;
8988
int32_t offset = 0;
9089
size_t noffset = 0;
@@ -122,7 +121,7 @@ PHP_FUNCTION(grapheme_strpos)
122121
}
123122

124123
/* do utf16 part of the strpos */
125-
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0, locale /* last */ );
124+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0, "" /* last */ );
126125

127126
if ( ret_pos >= 0 ) {
128127
RETURN_LONG(ret_pos);
@@ -148,7 +147,7 @@ PHP_FUNCTION(grapheme_stripos)
148147
Z_PARAM_STRING(needle, needle_len)
149148
Z_PARAM_OPTIONAL
150149
Z_PARAM_LONG(loffset)
151-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
150+
Z_PARAM_STRING(locale, locale_len)
152151
ZEND_PARSE_PARAMETERS_END();
153152

154153
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
@@ -272,7 +271,7 @@ PHP_FUNCTION(grapheme_strripos)
272271
Z_PARAM_STRING(needle, needle_len)
273272
Z_PARAM_OPTIONAL
274273
Z_PARAM_LONG(loffset)
275-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
274+
Z_PARAM_STRING(locale, locale_len)
276275
ZEND_PARSE_PARAMETERS_END();
277276

278277
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
@@ -553,15 +552,14 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
553552
Z_PARAM_STRING(needle, needle_len)
554553
Z_PARAM_OPTIONAL
555554
Z_PARAM_BOOL(part)
556-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
555+
Z_PARAM_STRING(locale, locale_len)
557556
ZEND_PARSE_PARAMETERS_END();
558557
} else {
559558
ZEND_PARSE_PARAMETERS_START(2, 3)
560559
Z_PARAM_STRING(haystack, haystack_len)
561560
Z_PARAM_STRING(needle, needle_len)
562561
Z_PARAM_OPTIONAL
563562
Z_PARAM_BOOL(part)
564-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
565563
ZEND_PARSE_PARAMETERS_END();
566564
}
567565

@@ -944,7 +942,7 @@ PHP_FUNCTION(grapheme_levenshtein)
944942
Z_PARAM_LONG(cost_ins)
945943
Z_PARAM_LONG(cost_rep)
946944
Z_PARAM_LONG(cost_del)
947-
Z_PARAM_STRING_OR_NULL(locale, locale_len)
945+
Z_PARAM_STRING(locale, locale_len)
948946
ZEND_PARSE_PARAMETERS_END();
949947

950948
if (cost_ins <= 0 || cost_ins > UINT_MAX / 4) {

ext/intl/php_intl.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,21 +433,21 @@ function grapheme_strlen(string $string): int|false|null {}
433433

434434
function grapheme_strpos(string $haystack, string $needle, int $offset = 0): int|false {}
435435

436-
function grapheme_stripos(string $haystack, string $needle, int $offset = 0, ?string $locale = null): int|false {}
436+
function grapheme_stripos(string $haystack, string $needle, int $offset = 0, string $locale = ""): int|false {}
437437

438438
function grapheme_strrpos(string $haystack, string $needle, int $offset = 0): int|false {}
439439

440-
function grapheme_strripos(string $haystack, string $needle, int $offset = 0, ?string $locale = null): int|false {}
440+
function grapheme_strripos(string $haystack, string $needle, int $offset = 0, string $locale = ""): int|false {}
441441

442442
function grapheme_substr(string $string, int $offset, ?int $length = null): string|false {}
443443

444444
function grapheme_strstr(string $haystack, string $needle, bool $beforeNeedle = false): string|false {}
445445

446-
function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle = false, ?string $locale = null): string|false {}
446+
function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle = false, string $locale = ""): string|false {}
447447

448448
function grapheme_str_split(string $string, int $length = 1): array|false {}
449449

450-
function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, ?string $locale = null): int|false {}
450+
function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ""): int|false {}
451451

452452
/** @param int $next */
453453
function grapheme_extract(string $haystack, int $size, int $type = GRAPHEME_EXTR_COUNT, int $offset = 0, &$next = null): string|false {}

0 commit comments

Comments
 (0)