From: Operating system: Windows PHP version: 5.3SVN-2011-04-03 (SVN) Package: Variables related Bug Type: Bug Bug description:Comparison with intval()
Description:
------------
comparisons with intval() function with real values between 1 and 2 (like
1.2 1.3
etc).
Every return any fail;
Test script:
---------------
$numero = "1.1";
if (intval($numero * 100) == $numero * 100)
{
echo intval($numero * 100) . ":" . $numero * 100 . "<br/>";
echo "Number OK!";
} else {
echo intval($numero * 100) . ":" . $numero * 100 . "<br/>"; //Return
110:110 (same) but the comparison has fail
echo "The number shoud contains 2 decimal places";
}
Expected result:
----------------
110:110
Number OK!
OBS: With the variable with the 2.1 for example, the return result are the
expected.
Actual result:
--------------
110:110
The number shoud contains 2 decimal places
--
Edit bug report at http://bugs.php.net/bug.php?id=54458&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54458&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54458&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=54458&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54458&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=54458&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54458&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=54458&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=54458&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=54458&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=54458&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=54458&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=54458&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=54458&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54458&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54458&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54458&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=54458&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=54458&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=54458&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=54458&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=54458&r=mysqlcfg
