public void clear() {
        modCount++;
        ArrayMapEntryMemory[] data = this.data;
        for (int i = data.length - 1; i >= 0; i--) {
            data[i] = null;
        }
        size = 0;

        header.before = header.after = header;
    }
Clears the map, resetting the size to zero and nullifying references
to avoid garbage collection issues.
jphp-runtime/src/php/runtime/memory/support/ArrayMemoryMap.java