Skip to content

Commit 8937eb3

Browse files
Merge pull request #495 from malaynayak/php8-compatibility
Fixed php 8 compatibility related to INI directive mbstring.func_overload.
2 parents 9b1a614 + 1bcf335 commit 8937eb3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Core.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public static function ourStrlen($str)
285285
{
286286
static $exists = null;
287287
if ($exists === null) {
288-
$exists = \extension_loaded('mbstring') && \ini_get('mbstring.func_overload') !== false && (int)\ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING;
288+
$exists = \extension_loaded('mbstring') && \function_exists('mb_strlen');
289289
}
290290
if ($exists) {
291291
$length = \mb_strlen($str, '8bit');
@@ -311,7 +311,7 @@ public static function ourSubstr($str, $start, $length = null)
311311
{
312312
static $exists = null;
313313
if ($exists === null) {
314-
$exists = \extension_loaded('mbstring') && \ini_get('mbstring.func_overload') !== false && (int)\ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING;
314+
$exists = \extension_loaded('mbstring') && \function_exists('mb_substr');
315315
}
316316

317317
// This is required to make mb_substr behavior identical to substr.

0 commit comments

Comments
 (0)