IterableImplementation relies on a zero-indexed offset; when filtering a collection $collection->periods array isn't reindexed, causing collection iteration to stop at the first hole in the index.
Applying array_values to array_filter results fixes the bug.
array_valuesperforms better than splat-packing.
IterableImplementation
relies on a zero-indexed offset; when filtering a collection$collection->periods
array isn't reindexed, causing collection iteration to stop at the first hole in the index. Applyingarray_values
toarray_filter
results fixes the bug.array_values
performs better than splat-packing.