Skip to content

Add new flag ARRAY_FILTER_PACK_RESULT#22155

Open
DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:ARRAY_FILTER_PACK_RESULT
Open

Add new flag ARRAY_FILTER_PACK_RESULT#22155
DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:ARRAY_FILTER_PACK_RESULT

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Member

No description provided.

@DanielEScherzer
Copy link
Copy Markdown
Member Author

Requested by someone at PHPTek and seemed pretty simple to implement
Our current documentation notes that

Array keys are preserved, and may result in gaps if the array was indexed. The result array can be reindexed using the array_values() function.

This would eliminate the need for an extra method call and improve performance

Plenty of existing code would use this: https://github.com/search?q=language%3Aphp%20-is%3Afork%20-is%3Aarchived%20%2F%5C%5C%3Farray_values%5C(%5Cs*%5C%5C%3Farray_filter%2F&type=code

let me know if an RFC is needed, not sure if this is small enough or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant