On 18 June 2013 00:20, Sherif Ramadan <theanomaly...@gmail.com> wrote:

> I'm starting up a thread for discussion on Pull Request 287
> https://github.com/php/php-src/pull/287 (allowing array keys to be passed
> to the callback function of array_filter through a third optional boolean
> argument).
>

Why not use array_filter_keys?

There are many other array functions that work with keys using this naming
pattern. This would make it clearer in the code what is being filtered, and
no need for the additional parameter.

In this case I think I would still prefer it if the callback took a single
parameter. Values can still be easily looked up with $array[$key] in user
defined callbacks, but all of the built-in functions that take a single
parameter are still available to use.

Reply via email to