You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting array is ['Key' => 'One', 0 => 'Two'], which doesn't make any sense. Same for skip(). (array_slice() reindexes integer keys, but keeps string keys -.-)
What should be done now is:
limit() and skip() should preserve keys (add true flag to array_slice()) - this probably makes more sense
limit() and skip() should reindex the array (use array_values())
The text was updated successfully, but these errors were encountered:
danon
changed the title
FluentArray.skip() and limit() leaks array_slice() implementation detailFluentArray.skip() and limit() leak array_slice() implementation detail
May 2, 2022
If you run this
The resulting array is
['Key' => 'One', 0 => 'Two']
, which doesn't make any sense. Same forskip()
. (array_slice()
reindexes integer keys, but keeps string keys -.-)What should be done now is:
limit()
andskip()
should preserve keys (addtrue
flag toarray_slice()
) - this probably makes more senselimit()
andskip()
should reindex the array (usearray_values()
)The text was updated successfully, but these errors were encountered: