src/Util/Strings.php
public static function compare(string $left, string $right, int $len = null): bool
    {
        if (\class_exists('\Normalizer', false)) {
            $left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster
            $right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster
        }

        if ($len < 0) {
            $left = \mb_substr($left, $len, -$len);
            $right = \mb_substr($right, $len, -$len);
        } elseif ($len !== null) {
            $left = \mb_substr($left, 0, $len);
            $right = \mb_substr($right, 0, $len);
        }

        return \mb_strtolower($left) === \mb_strtolower($right);
    }
public static function compare(string $left, string $right, int $len = null): bool
    {
        if (\class_exists('\Normalizer', false)) {
            $left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster
            $right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster
        }

        if ($len < 0) {
            $left = \mb_substr($left, $len, -$len);
            $right = \mb_substr($right, $len, -$len);
        } elseif ($len !== null) {
            $left = \mb_substr($left, 0, $len);
            $right = \mb_substr($right, 0, $len);
        }

        return \mb_strtolower($left) === \mb_strtolower($right);
    }
public static function compare ( string $ left , string $ right , int $ len = null ) : bool { if ( \ class_exists ( '\Normalizer' , false ) ) { $ left = \ Normalizer :: normalize ( $ left , \ Normalizer :: FORM_D ) ; // form NFD is faster $ right = \ Normalizer :: normalize ( $ right , \ Normalizer :: FORM_D ) ; // form NFD is faster } if ( $ len < 0 ) { $ left = \ mb_substr ( $ left , $ len , - $ len ) ; $ right = \ mb_substr ( $ right , $ len , - $ len ) ; } elseif ( $ len !== null ) { $ left = \ mb_substr ( $ left , 0 , $ len ) ; $ right = \ mb_substr ( $ right , 0 , $ len ) ; } return \ mb_strtolower ( $ left ) === \ mb_strtolower ( $ right ) ; }
Case-insensitive compares UTF-8 strings.

@param  string
@param  string
@param  int

@return bool
Case - insensitive compares UTF - 8 strings .