From: mlsx at cie dot xtu dot edu dot cn Operating system: windows server 2003 PHP version: 4.3.3 PHP Bug Type: Math related Bug description: cannot get the right value when i use + operator
Description: ------------ first i define a is 8 and b is 6. When i use echo "a+b=".$a+$b."<br>"; the MS IE show the result is 2. While i use echo "a+b="; echo $a+$b."<br>"; the result is correct! the same result when use "-" operator use a line command. but the result is correct when i use * and / i cannnot fix it! Reproduce code: --------------- <?php $a = 8; $b = 2; $c = 3; echo "a+b=".$a+$b."<br>"; echo "a-b=".$a-$b."<br>"; echo "a*b=".$a*$b."<br>"; echo "a/b=".$a/$b."<br>"; echo "a%c=".$a%$c."<br>"; echo "a++ is ".$a++; ?> Expected result: ---------------- 2 -2 a*b=16 a/b=4 a%c=2 a++ is 8 Actual result: -------------- a+b=10 a-b=6 a*b=16 a/b=4 a%c=2 a++ is 8 -- Edit bug report at http://bugs.php.net/?id=26624&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26624&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26624&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26624&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26624&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26624&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26624&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26624&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26624&r=support Expected behavior: http://bugs.php.net/fix.php?id=26624&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26624&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26624&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26624&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26624&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26624&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26624&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26624&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26624&r=float