On 26/09/2013 05:42, Tjerk Meesters wrote:
Hi,

I've updated my patch to allow a range of values to be passed as the third
argument: pass key, pass value or pass both.

Instead of using OR-able constants, I went with an enumeration type because
there are only going to be three options; it just felt wrong to have
`ARRAY_FILTER_USE_KEY | ARRAY_FILTER_USE_VALUE` instead of a simpler
`ARRAY_FILTER_USE_BOTH` or even just `true`.

I suggest the following change:

ext/standard/php_array.h:119:
> #define ARRAY_FILTER_USE_BOTH  1
> #define ARRAY_FILTER_USE_KEY  2
> #define ARRAY_FILTER_USE_VALUE  3

becomes:

ext/standard/php_array.h:119:
> #define ARRAY_FILTER_USE_KEY  1
> #define ARRAY_FILTER_USE_VALUE  2
> #define ARRAY_FILTER_USE_BOTH  3

Such that we have the best of both worlds, either `ARRAY_FILTER_USE_BOTH` or `ARRAY_FILTER_USE_KEY | ARRAY_FILTER_USE_VALUE` :D

--
Andrea Faulds
http://ajf.me/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to