FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » bug in is_numeric
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: bug in is_numeric [message #181351 is a reply to message #181350] Mon, 13 May 2013 14:11 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 5/13/2013 9:58 AM, fred wrote:
> In article <5190d3a0$0$15991$e4fe514c(at)news2(dot)news(dot)xs4all(dot)nl>,
> erwinmollerusenet(at)xs4all(dot)nl says...
>> So on your current set-up is_numeric() seems to work fine.
>> It returns false, as expected.
>>
>
> No.
> is_numeric() returns true.
> It was var_dump() that reurned false.
>

As others have shown, is_numeric() returns false in several versions of PHP.

>> But you claimed in your original post, the test returned true.
>> I am confused now. :-)
>
> Yes you are confused.
>
>> Could you give us the (relevant) code that made you make your first >
>> claim?
>
> $a = 'x11.11c';
> if(is_numeric($a)) { echo('oops - a problem' . '<BR>') } ;
>
>> I expect it does something else than you think it does.
>
> What it does is something that I didn't think right - as stated.
>

Is that cut and paste of your actual code? Is it your entire code?

What happens with the following code:

echo is_numeric('x11.11c') ? 'true' : 'false';




--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem encrypting data (AES_ENCRYPT/AES_DECRYPT)
Next Topic: Debian: php fast-cgi along with mod_php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 07:04:54 GMT 2024

Total time taken to generate the page: 0.04823 seconds