@Immutable
    public static Memory implode(Environment env, TraceInfo trace, Memory glue, Memory pieces) {
        ArrayMemory array;
        String delimiter;
        if (glue.isArray()) {
            array = (ArrayMemory) glue;
            delimiter = pieces.toString();
        } else if (pieces.isArray()) {
            array = (ArrayMemory) pieces;
            delimiter = glue.toString();
        } else {
            env.warning(trace, "Argument must be an array");
            return Memory.NULL;
        }

        StringBuilder builder = new StringBuilder();
        int i = 0, size = array.size();
        for (Memory el : array) {
            builder.append(el.toString());
            if (i != size - 1)
                builder.append(delimiter);
            i++;
        }

        return new StringMemory(builder.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