@Immutable
    public static Memory chunk_split(Environment env, TraceInfo trace, String body, int chunkLen, String end) {
        if (chunkLen < 1) {
            env.warning(trace, "chunk_split(): Chunk length should be greater than zero");
            return Memory.FALSE;
        }

        StringBuilder sb = new StringBuilder();
        int i = 0;

        for (; i + chunkLen <= body.length(); i += chunkLen) {
            sb.append(body, i, i + chunkLen);
            sb.append(end);
        }

        if (i < body.length()) {
            sb.append(body.substring(i));
            sb.append(end);
        }

        return new StringMemory(sb.toString());
    }
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