Hi,
        An empty string returns 0.

php -r "$var=''; var_dump(filter_data($var, FILTER_VALIDATE_INT));"
int(0)

Which maybe is what was intended, but imho still should return false.

Jared

> -----Original Message-----
> From: Pierre [mailto:[EMAIL PROTECTED] 
> Sent: 28 July 2006 17:44
> To: Kevin Waterson
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] testing filter ext in RC1
> 
> On 7/28/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:
> > This one time, at band camp, Pierre <[EMAIL PROTECTED]> wrote:
> >
> >
> > > > if var was abc1234 then it would return NULL, is that correct?
> > >
> > > False if the value is not valid, null if the value does 
> not exist (for
> > > example with input_get or input_get_args). In the case of 
> filter_data,
> > > as you pass the variable, it will be either false or the correct
> > > value.
> >
> > here it returns '0'
> 
> Please show me some code, "here" is not really helpful. For example:
> 
> $ php -r '$var=1234; var_dump(filter_data($var, 
> FILTER_VALIDATE_INT));'
> int(1234)
> 
> $ php -r '$var=ab1234; var_dump(filter_data($var, 
> FILTER_VALIDATE_INT));'
> bool(false)
> 
> --Pierre
> 
> -- 
> 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