#24054 [Ver->Ctl]: Assignment Operateors (*=)
| From: | sniper@php.net | Date: | Fri, 06 Jun 2003 11:10:43 +0000 |
| Subject: | #24054 [Ver->Ctl]: Assignment Operateors (*=) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41336@lists.php.net to get a copy of this message | ||
ID: 24054
Updated by: sniper@php.net
Reported By: spam at oops dot org
-Status: Verified
+Status: Critical
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.2
New Comment:
PHP 4.2.3:
-----------
float(10010000000)
float(10010000000)
PHP 4.3.1:
----------
float(1.001E+10)
float(1.001E+10)
PHP 4.3.2:
----------
float(1421485473408)
float(1.001E+10)
I've added a test case for this and this has to be fixed before 4.3.3.
Previous Comments:
------------------------------------------------------------------------
[2003-06-06 05:20:57] edink@php.net
It seems that something goes wrong when casting to float on integer
overflow.
$ php -r '$i=10000000; $i*=1001; var_dump($i);'
float(1421485473408)
$ php -r '$i=10000000*1001; var_dump$i);'
float(1.001E+10)
------------------------------------------------------------------------
[2003-06-06 04:25:26] spam at oops dot org
4.3.2 has assignment operateors problem.
<?php
$i = 10000000;
$i *= 1001;
echo $i;
?>
upper code returns "1421485473408".
but
<?php
$i = 10000000;
$i = $i * 1001;
echo $i;
?>
upper code is success return "10010000000".
*= operator has not always problem.
if about bigger than 1000000000, problem is occured. :-)
P.S
sorry for my poor english.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24054&edit=1