private static Memory strspnImpl(String string, String characters, int offset, int length, boolean isMatch) {
        int strlen = string.length();

        if (offset < 0) {
            offset += strlen;

            if (offset < 0) {
                offset = 0;
            }
        }

        if (offset > strlen) {
            return Memory.FALSE;
        }

        if (length == -2147483648) {
            length = strlen;
        } else if (length < 0) {
            length += (strlen - offset);

            if (length < 0) {
                length = 0;
            }
        }

        int end = offset + length;

        if (strlen < end) {
            end = strlen;
        }

        int count = 0;

        for (; offset < end; offset++) {
            char ch = string.charAt(offset);
            boolean isPresent = characters.indexOf(ch) > -1;

            if (isPresent == isMatch) {
                count++;
            } else {
                return LongMemory.valueOf(count);
            }
        }

        return LongMemory.valueOf(count);
    }
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