Hello,

On 9/19/06, Derick Rethans <[EMAIL PROTECTED]> wrote:

> > unless FILTER_FLAG_ARRAY is given in which case it should behave like
> > before. This would make it easier to use the filtered values IMHO.
>
> It always returns an array when FILTER_FLAG_ARRAY is given.  Even when
> the input value was a scalar. It spares yet another is_array/isset
> test. And it accepts only scalar by default or when FILTER_FLAG_SCALAR
> is given.

I would not expect that... I thought the FLAG would just mean that it
would iterate over a whole array and allow it. I think that we should
add a second flag called "FORCE_ARRAY" or something instead.

The flag allows arrays and always returns an array. It is obvious as
if you allow array or scalar, you have to use is_array, that's a step
we easily drop internally by always returning an array. I do not see
the point to have ALLOW_ARRAY and FORCE_ARRAY. It is confusing.

--Pierre

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

Reply via email to