Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Ron Korving
So when you said "and somebody enters, say "jkhdsjh" into the form, is_int() returns 1" you were not really saying it as it was? $var = "jkhdsjh"; is_int($var) should _not_ result in true. i figured you were talking about a true bug here... Ron "Gareth Ardron" <[EMAIL PROTECTED]> wrote in messa

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Bastian Grupe
Ben Litton wrote: > > You could always do an is_numeric and if it returns true, cast it as an > int. That is the way it's meant to be done. is_int() really checks for the dataTYPE and not the CONTENTS (of course the contents depend on the type, e.g. in an int you won't find a string). giving i

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Ben Litton
On Tue, 29 Nov 2005 12:53:47 -0500, "Sara Golemon" <[EMAIL PROTECTED]> wrote: is_numeric will test if it's a numeric string. Maybe is_int should do the same, but apparently it doesn't. What on earth for? If you want content, do is_numeric(). If you want type, do is_int() Simple. -Sa

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Gareth Ardron
Stefan Esser wrote: Please move the discussion to php general mailinglist. This is a usererror, a misunderstanding of is_int vs. is_numeric. My bad therefore, misunderstanding of the docs as you say. Not sure I think it's entirely sane, but feh - it's been a long day, what do I know, etc etc.

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Stefan Esser
Please move the discussion to php general mailinglist. This is a usererror, a misunderstanding of is_int vs. is_numeric. The documentation clearly states, that is_numeric - Finds whether a variable is a number or a numeric string is_int - Find whether a variable is an integer anything within $_R

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Sara Golemon
is_numeric will test if it's a numeric string. Maybe is_int should do the same, but apparently it doesn't. What on earth for? If you want content, do is_numeric(). If you want type, do is_int() Simple. -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Matteo Beccati
Ben Litton wrote: is_numeric will test if it's a numeric string. Maybe is_int should do the same, but apparently it doesn't. You could always do an is_numeric and if it returns true, cast it as an int. Or use: www.php.net/ctype_digit Ciao ciao -- Matteo Beccati http://phpadsnew.com http://

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Ben Litton
is_numeric will test if it's a numeric string. Maybe is_int should do the same, but apparently it doesn't. You could always do an is_numeric and if it returns true, cast it as an int. On Tue, 29 Nov 2005 12:42:10 -0500, Gareth Ardron <[EMAIL PROTECTED]> wrote: Matteo Beccati wrote: Ga

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Gareth Ardron
Matteo Beccati wrote: Gareth Ardron wrote: Ron Korving wrote: Just out of curiosity, to which versions does this apply? 5.1.0b3->5.1.1 at least. Haven't got anything older to test on. As far as I know request variables have always been strings, and is_int() checks the variable type, no

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Matteo Beccati
Gareth Ardron wrote: Ron Korving wrote: Just out of curiosity, to which versions does this apply? 5.1.0b3->5.1.1 at least. Haven't got anything older to test on. As far as I know request variables have always been strings, and is_int() checks the variable type, not its content. I wonder h

Re: [PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Gareth Ardron
Ron Korving wrote: Just out of curiosity, to which versions does this apply? 5.1.0b3->5.1.1 at least. Haven't got anything older to test on. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: is_int/is_numeric possible bug

2005-11-29 Thread Ron Korving
Just out of curiosity, to which versions does this apply? Ron "Gareth Ardron" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Hi. > > Think I've just stumbled upon a possible bug with is_int. > > if you've got the following code: > > > > > > if (!is_int($_REQUEST['days']) |