JBZoo\Utils\Str::isOverload PHP Method

isOverload() public static method

Check is mbstring oeverload standard functions
public static isOverload ( ) : integer
return integer
    public static function isOverload()
    {
        if (self::isMBString()) {
            return (int) Sys::iniGet('mbstring.func_overload') & MB_OVERLOAD_STRING;
        }
        // @codeCoverageIgnoreStart
        return false;
        // @codeCoverageIgnoreEnd
    }

Usage Example

Example #1
0
 public function testMBString()
 {
     isSame(Str::isMBString(), function_exists('mb_strtoupper'));
     isSame(Str::isOverload(), (int) ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING);
     is(5, Str::len('Денис'));
     isSame(1, Str::pos('Денис', 'е'));
     isSame(false, Str::pos('Денис', 'Е'));
     isSame(3, Str::rpos('Денис', 'и'));
     isSame(1, Str::ipos('Денис', 'Е'));
     isSame(1, Str::ipos('Денис', 'Е'));
     isSame('енис', Str::strstr('Денис', 'е'));
     isSame('енис', Str::istr('Денис', 'Е'));
     isSame('ис', Str::rchr('Денис', 'и'));
     isSame('нис', Str::sub('Денис', 2));
     isSame('ени', Str::sub('Денис', 1, 3));
     isSame('денис', Str::low('ДЕНИС'));
     isSame('ДЕНИС', Str::up('денис'));
     isSame(2, Str::subCount('денис ДеНИС', 'е'));
     isSame(1, Str::subCount('денис ДеНИС', 'И'));
     isTrue(Str::isStart('денис', 'ден', true));
     isTrue(Str::isStart('денис', 'ДЕН', false));
     isFalse(Str::isStart('денис', 'ДЕН', true));
     isTrue(Str::isEnd('денис', 'нис', true));
     isTrue(Str::isEnd('денис', 'НИС', false));
     isFalse(Str::isEnd('денис', 'ДЕНИС', true));
 }