diff --git a/UnicodeString.php b/UnicodeString.php index 81bf8ea..16945b7 100644 --- a/UnicodeString.php +++ b/UnicodeString.php @@ -268,7 +268,7 @@ public function slice(int $start = 0, int $length = null): AbstractString { $str = clone $this; try { - $str->string = (string) grapheme_substr($this->string, $start, $length ?? \PHP_INT_MAX); + $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); } catch (\ValueError $e) { $str->string = ''; } @@ -280,8 +280,8 @@ public function splice(string $replacement, int $start = 0, int $length = null): { $str = clone $this; $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? \PHP_INT_MAX)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); + $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; + $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); if (false === $str->string) { @@ -293,7 +293,7 @@ public function splice(string $replacement, int $start = 0, int $length = null): public function split(string $delimiter, int $limit = null, int $flags = null): array { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { + if (1 > $limit = $limit ?? 2147483647) { throw new InvalidArgumentException('Split limit must be a positive integer.'); } diff --git a/composer.json b/composer.json index 6d89808..b77be0b 100644 --- a/composer.json +++ b/composer.json @@ -37,5 +37,7 @@ ] }, "minimum-stability": "dev", - "version": "5.2.x-dev" + "extra": { + "branch-version": "5.2-dev" + } }