Hi,

On 27 Sep, 2013, at 12:31 AM, Andrea Faulds <a...@ajf.me> wrote:

> 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

I deliberately chose these values so that I can simply specify `true` to mean 
pass both values. Bit masks seem cumbersome in this situation. 

> 
> -- 
> Andrea Faulds
> http://ajf.me/
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

Reply via email to