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 #181357 is a reply to message #181352] Mon, 13 May 2013 15:29 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 5/13/2013 4:15 PM, fred wrote:
> In article <kmqs3c$e3s$1(at)dont-email(dot)me>, jstucklex(at)attglobal(dot)net says...
>> As others have shown, is_numeric() returns false in several versions of PHP.
>>
>
> I have just typed in an exact copy of the test in my message of 02:58pm
> When you have run that on an apache PHP installation of the same version
> PHP as I listed (5.3.6) under windows7-64 bit - get back to me.
>
> Otherwise I'm done repeating myself.
>
>

Dear Fred,

The problem is this: You claim that your tests return true AND false.
That is why I am confused, and propably most readers in here.

You claim (in your original posting) that
if(is_numeric('x11.11c'))
returns TRUE

And you also claim that the test Salvatore suggested returns false:
<?php $a = is_numeric('x11.11c'); var_dump($a); ?>
That results in false, you posted.

Do you see the problem?

Same string ('x11.11c'), same function is_numeric, but different results.

So no need to repeat yourself, but at least take the time to look into
this problem.

I bet your code tests something else than you think it tests.
For example a row from a query, which you misinterpret, or a false
result that you juggle into a number, etc.etc.

eg: Some db-problem -> row is false -> you juggle false into 0, and test
if 0 is numeric.

There are many common mistakes possible, and some people in here can
spot them right away (because they made the same mistakes themself earlier).

Hence the question if you can post more ACTUAL code.
You showed yourself that the function is_numeric WORKS on your system by
posting the result of Salvatore's test.


Regards,
Erwin Moller


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[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: Thu Apr 03 06:25:22 GMT 2025

Total time taken to generate the page: 0.04705 seconds