Immutable collections, with filter, map, join, sort, slice, and other methods. Well-suited for functional programming and memory-intensive applications. Runs especially fast in PHP7.
To be javascript-like, the original implementation made a slice as a full clone. However, this is only necessary in JS specifically because an array is mutable. On an immutable array, it makes more sense to define an ArrayAccess, JsonSerializable LimitIterator to simply access a subset of the target ImmArray. It's not going anywhere in memory, so no need to clone when we can simply iterate at an offset.
To be javascript-like, the original implementation made a slice as a full clone. However, this is only necessary in JS specifically because an array is mutable. On an immutable array, it makes more sense to define an ArrayAccess, JsonSerializable LimitIterator to simply access a subset of the target ImmArray. It's not going anywhere in memory, so no need to clone when we can simply iterate at an offset.