Hi Christoph,

On Mon, Aug 1, 2016 at 7:08 PM, Christoph Becker <cmbecke...@gmx.de> wrote:
>> We have filter_var_array()/filter_input_array() currently. They are
>> designed as filter functions.  i.e. They convert offending elements to
>> NULL/FALSE. Therefore, it's difficult to validate and see if inputs
>> are valid with specified specifications.
>
> Maybe I'm missing something, but wouldn't a comparision of the original
> array with the filtered array already suffice, see <https://3v4l.org/GlT49>?

It may work, but it changes data types when it's possible.
Float value could be headache.

https://3v4l.org/3DUmn

 - Comparing array by == is too slow for extensive use of validations.
 - "Validate and reject" is better than "Filter and accept" for most
applications.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

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

Reply via email to