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
This is really disturbing and unintuitive, no other language (AFAIK) do that. I know PHP always had this permanent confusion between lists and maps, but this doesn't feel right: if I filter a list I should get a filtered list in return.
Would you consider adding a boolean argument forceList or adding a filterList method who always return array_values in the internal state ?
The text was updated successfully, but these errors were encountered:
Yes, I would add such a functionality. Since PHP can filter both maps and lists I would prefer if we add an additional function filterList(), to make the behavior more clear.
When you filter an array, it may become 'sparse'. PHP deals with this situation by turning it to an associative array:
https://eval.in/916518
This is really disturbing and unintuitive, no other language (AFAIK) do that. I know PHP always had this permanent confusion between lists and maps, but this doesn't feel right: if I filter a list I should get a filtered list in return.
Would you consider adding a boolean argument
forceList
or adding afilterList
method who always returnarray_values
in the internal state ?The text was updated successfully, but these errors were encountered: