Closed dantleech closed 9 years ago
I am not sure about this: array_replace_at
implies that the index must exist. Would it ever be a valid case to set a non-existing index? I guess not, but if it were valid then array_set
would be a better name,
as phpcr arrays are consequitive arrays and not hashmaps, you can't set a new index. we could allow the edge case of hitting the spot after the last element and in this case add the element. or in general say that if the index is higher than the last, it actually appends. this is probably better than doing an error in that case.
//cc @dbu