protected static function ourStrlen($str)
    {
        // Premature optimization: cache the function_exists() result
        static $exists = null;
        if ($exists === null) {
            $exists = \function_exists('\\mb_strlen');
        }

        // If it exists, we need to make sure we're using 8bit mode
        if ($exists) {
            return \mb_strlen($str, '8bit');
        }
        return \strlen($str);
    }
protected static function ourStrlen($str)
    {
        // Premature optimization: cache the function_exists() result
        static $exists = null;
        if ($exists === null) {
            $exists = \function_exists('\\mb_strlen');
        }

        // If it exists, we need to make sure we're using 8bit mode
        if ($exists) {
            return \mb_strlen($str, '8bit');
        }
        return \strlen($str);
    }
protected static function ourStrlen ( $ str ) { // Premature optimization: cache the function_exists() result static $ exists = null ; if ( $ exists === null ) { $ exists = \ function_exists ( '\\mb_strlen' ) ; } // If it exists, we need to make sure we're using 8bit mode if ( $ exists ) { return \ mb_strlen ( $ str , '8bit' ) ; } return \ strlen ( $ str ) ; }
Multi-byte-safe string length calculation

@param string $str
@return int
Multi - byte - safe string length calculation