@@ -268,7 +268,7 @@ public function slice(int $start = 0, int $length = null): AbstractString
268
268
{
269
269
$ str = clone $ this ;
270
270
try {
271
- $ str ->string = (string ) grapheme_substr ($ this ->string , $ start , $ length ?? \ PHP_INT_MAX );
271
+ $ str ->string = (string ) grapheme_substr ($ this ->string , $ start , $ length ?? 2147483647 );
272
272
} catch (\ValueError $ e ) {
273
273
$ str ->string = '' ;
274
274
}
@@ -280,8 +280,8 @@ public function splice(string $replacement, int $start = 0, int $length = null):
280
280
{
281
281
$ str = clone $ this ;
282
282
$ start = $ start ? \strlen (grapheme_substr ($ this ->string , 0 , $ start )) : 0 ;
283
- $ length = $ length ? \strlen (grapheme_substr ($ this ->string , $ start , $ length ?? \ PHP_INT_MAX )) : $ length ;
284
- $ str ->string = substr_replace ($ this ->string , $ replacement , $ start , $ length ?? \ PHP_INT_MAX );
283
+ $ length = $ length ? \strlen (grapheme_substr ($ this ->string , $ start , $ length ?? 2147483647 )) : $ length ;
284
+ $ str ->string = substr_replace ($ this ->string , $ replacement , $ start , $ length ?? 2147483647 );
285
285
normalizer_is_normalized ($ str ->string ) ?: $ str ->string = normalizer_normalize ($ str ->string );
286
286
287
287
if (false === $ str ->string ) {
@@ -293,7 +293,7 @@ public function splice(string $replacement, int $start = 0, int $length = null):
293
293
294
294
public function split (string $ delimiter , int $ limit = null , int $ flags = null ): array
295
295
{
296
- if (1 > $ limit = $ limit ?? \ PHP_INT_MAX ) {
296
+ if (1 > $ limit = $ limit ?? 2147483647 ) {
297
297
throw new InvalidArgumentException ('Split limit must be a positive integer. ' );
298
298
}
299
299
0 commit comments