ID:               37403
 User updated by:  jonataswalker at gmail dot com
 Reported By:      jonataswalker at gmail dot com
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux 2.6.13
 PHP Version:      5.1.4
 New Comment:

Well, the answer came very quick, thank you.
I read the recommended article but I didn't understand.
What would it be a solution?


Previous Comments:
------------------------------------------------------------------------

[2006-05-11 06:50:09] [EMAIL PROTECTED]

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.

.

------------------------------------------------------------------------

[2006-05-11 04:02:33] jonataswalker at gmail dot com

Description:
------------
Hi there,

I'd like some help. I've searched and found a similar question but no
answer was given, so I need to ask same thing.

How can this be possible?

Reproduce code:
---------------
$array =
array(3453453453453453453445345345,345345345345345346452,12345);
$key = array_search(345345345345345340300,$array,true);
if ($key === false) print "false";
else print var_dump($key);

Expected result:
----------------
false

Actual result:
--------------
int(1). Even changing last 4 digits in needle, I always get int(1).


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37403&edit=1

Reply via email to