Re: PR 287 - added use_keys argument to array_filter() [Discussion]

From: Date: Tue, 18 Jun 2013 15:27:04 +0000
Subject: Re: PR 287 - added use_keys argument to array_filter() [Discussion]
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-67719@lists.php.net to get a copy of this message
On 18 June 2013 00:20, Sherif Ramadan <theanomaly.is@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.

« previous php.internals (#67719) next »