Re: Adding validate_var_array()/validate_input_array() towhich version?
| From: | Christoph Becker | Date: | Fri, 05 Aug 2016 09:17:04 +0000 |
| Subject: | Re: Adding validate_var_array()/validate_input_array() towhich version? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94851@lists.php.net to get a copy of this message | ||
On 05.08.2016 at 02:15, Yasuo Ohgaki wrote:
> Pierre suggested the functions should be named "filter_*" and I agree.
>
> On Fri, Aug 5, 2016 at 6:25 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>> Input validation is like assertion shouldn't fail.
>
> How about
>
> filter_assert_var() <- validate_var()
> filter_assert_var_array() <- validate_var_array()
> filter_assert_input() <- validate_input()
> filter_assert_input_array() <- validate_input_array()
>
> It seems better than
>
> filter_validate_*()
>
> to me. These names encourage users to use them for input assertion(validation).
>
> Any other good names?
I think the names are okay, but it should be pointed out that they are
not related to assert() (particularly, that they are not affected by the
assert.* ini directives). Maybe "assume" or "require" instead of
"assert" would therefore be better in this regard.
--
Christoph M. Becker