Replace IteratorAggregate
with Aggregate
in ArrayInterface
#269
Labels
Milestone
IteratorAggregate
with Aggregate
in ArrayInterface
#269
Since there are internal PHP issues with native arrays regarding array key types (https://3v4l.org/Y2ld5), I was testing a bit and found out that we could work around this issue when we are actually refactoring the
Array
implementation to:Iterator
implementation (which then can provide proper types rather than exposingArrayIterator
)Map
implementation to persist keys and values in dedicated lists while having indexes pointing to the according valueThe whole
Map
implementation should actually get refactored to avoid usingarray_*
functions in most scenarios (esp. when it comes to array keys).The return type of
MapInterface#toNativeArray
should also always havearray-key
, no matter of what the generic says. There is simply no guarantee that the array key is string and thus this is the best way to properly expose the weird PHP internal behavior which won't change too soon I guess.I have some ideas but I might not work on this too soon, just want to dump my current thoughts.
The text was updated successfully, but these errors were encountered: