Jason Garber wrote:
>   ifsetor is NOT input filtering, it is not a complex, general purpose

stuff like 'ifsetof()' is good when is use as:

>   $x = ifsetor($ANY_var, 'Default Value');

but too many times I need additional checks like this:

$x = isset($_REQUEST['x']) && is_number($x) ? $_REQUEST['x'] : null;

It's possible to add additional third parameter to ifsetof() ?

ifsetof(variable, expression [, callback])

callback is a function which take one argument (value of variable) and
return true or false. If return false 'expression' will be return from
ifsetor().

Usage:

$x = ifsetor($_REQUEST['x'], null, 'is_number');

>   It needs to be fast, and simple.

Hm... It's simple, but It's not very clean at first look.

What's your opinion?

-- 
Ondrej Ivnaic
([EMAIL PROTECTED])

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

Reply via email to