Bug #65304 [NEW]: Use of max int in array_sum
| From: | koushky at gmail dot com | Date: | Sun, 21 Jul 2013 09:37:52 +0000 |
| Subject: | Bug #65304 [NEW]: Use of max int in array_sum | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-180381@lists.php.net to get a copy of this message | ||
From: koushky at gmail dot com
Operating system: Ubuntu 13.04 64bit
PHP version: 5.4.17
Package: Arrays related
Bug Type: Bug
Bug description:Use of max int in array_sum
Description:
------------
If we add amount of max INT with number 1 in array_sum function , the
result will
be false.
While if we add this two via plus (+) operator ,the result will be true.
My operation system is 64 bit.
Test script:
---------------
/* max INT in 64bit = 9223372036854775807 */
var_dump(array_sum(array(9223372036854775807,1)));
var_dump(9223372036854775807+1);
Expected result:
----------------
int(-9223372036854775808)
float(9.2233720368548E+18)
Actual result:
--------------
float(9.2233720368548E+18)
float(9.2233720368548E+18)
--
Edit bug report at https://bugs.php.net/bug.php?id=65304&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65304&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65304&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65304&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65304&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65304&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65304&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65304&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65304&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65304&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65304&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65304&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65304&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65304&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65304&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65304&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65304&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65304&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65304&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65304&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65304&r=mysqlcfg