While implementing a look-up table as suggested in #2, I noticed that that the "shadowing order" is "first value for a key shadows all others". Therefore, to shadow a currently existing key inside an assoc. array, I am forced to unshift the entire array, which is much slower than just pushing a new value.
While I understand that this would be a breaking change, I suggest to change the shadowing order to "last value for a key shadows all previous", because otherwise the benefit of implementing #2 would be close to zero, given that for every unshift of the assoc. array, the lookup table would need to be completely re-calculated.
While implementing a look-up table as suggested in #2, I noticed that that the "shadowing order" is "first value for a key shadows all others". Therefore, to shadow a currently existing key inside an assoc. array, I am forced to
unshiftthe entire array, which is much slower than justpushing a new value.While I understand that this would be a breaking change, I suggest to change the shadowing order to "last value for a key shadows all previous", because otherwise the benefit of implementing #2 would be close to zero, given that for every
unshiftof the assoc. array, the lookup table would need to be completely re-calculated.