@Immutable
    public static Memory substr_compare(Environment env, TraceInfo trace, String mainStr, String str, int offset,
                                        Memory lenV, boolean isCaseInsensitive) {
        int strLen = mainStr.length();

        if (lenV != null && lenV.toInteger() == 0)
            return Memory.FALSE;

        int len = lenV == null ? 0 : lenV.toInteger();

        if (strLen < offset) {
            env.warning(trace, "offset can not be greater than length of string");
            return Memory.FALSE;
        }

        if (len > strLen || len + offset > strLen) {
            return Memory.FALSE;
        }

        if (lenV == null)
            mainStr = substr(mainStr, offset).toString();
        else
            mainStr = substr(mainStr, offset, len).toString();

        str = lenV == null ? str : substr(str, 0, len).toString();

        if (isCaseInsensitive)
            return LongMemory.valueOf(strcasecmp(mainStr, str));
        else
            return LongMemory.valueOf(strcmp(mainStr, str));
    }
Parses the cslashes bitmap returning an actual bitmap.

@param charset the bitmap string

@return the actual bitmap
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/StringFunctions.java