Skip to content

Commit 634ccdf

Browse files
minor #531 Fix registrering grapheme_str_split() (nicolas-grekas)
This PR was merged into the 1.x branch. Discussion ---------- Fix registrering grapheme_str_split() Commits ------- 4e555bd Fix registrering grapheme_str_split()
2 parents b17498d + 4e555bd commit 634ccdf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/Intl/Grapheme/bootstrap.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
use Symfony\Polyfill\Intl\Grapheme as p;
1313

14-
if (extension_loaded('intl')) {
15-
return;
16-
}
17-
1814
if (\PHP_VERSION_ID >= 80000) {
1915
return require __DIR__.'/bootstrap80.php';
2016
}

src/Intl/Grapheme/bootstrap80.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111

1212
use Symfony\Polyfill\Intl\Grapheme as p;
1313

14+
if (!function_exists('grapheme_str_split')) {
15+
function grapheme_str_split(string $string, int $length = 1): array|false { return p\Grapheme::grapheme_str_split($string, $length); }
16+
}
17+
18+
if (extension_loaded('intl')) {
19+
return;
20+
}
21+
1422
if (!defined('GRAPHEME_EXTR_COUNT')) {
1523
define('GRAPHEME_EXTR_COUNT', 0);
1624
}
@@ -48,6 +56,3 @@ function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle
4856
if (!function_exists('grapheme_substr')) {
4957
function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); }
5058
}
51-
if (!function_exists('grapheme_str_split')) {
52-
function grapheme_str_split(string $string, int $length = 1): array|false { return p\Grapheme::grapheme_str_split($string, $length); }
53-
}

0 commit comments

Comments
 (0)