Edit report at https://bugs.php.net/bug.php?id=65304&edit=1
ID: 65304 Patch added by: larue...@php.net Reported by: koushky at gmail dot com Summary: Use of max int in array_sum Status: Open Type: Bug Package: Arrays related Operating System: Ubuntu 13.04 64bit PHP Version: 5.4.17 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: bug65304.patch Revision: 1374408685 URL: https://bugs.php.net/patch-display.php?bug=65304&patch=bug65304.patch&revision=1374408685 Previous Comments: ------------------------------------------------------------------------ [2013-07-21 09:47:33] koushky at gmail dot com update ------------------------------------------------------------------------ [2013-07-21 09:37:52] koushky at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=65304&edit=1