Use of max int in array_sum

 [2013-07-21 09:37 UTC] 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)

 [2013-07-21 09:47 UTC] koushky at gmail dot com

update

 [2013-07-21 12:12 UTC] laruence@php.net

use fast_add_function here fixed the in-consistent.

 [2013-10-31 09:12 UTC] thuhc at yahoo dot com

This bug still happen on ARM 64bits (aarch64)

================================================================================
/root/php-5.5.4/ext/standard/tests/array/bug65304.phpt
================================================================================
int(-9223372036854775808)
float(9.2233720368548E+18)
================================================================================
001+ int(-9223372036854775808)
002- float(%s)
================================================================================

 [2013-12-10 10:05 UTC] thuhc at yahoo dot com

Related To: Bug #66242

 [2015-05-25 01:27 UTC] bugs at tmarques dot com

Related To: Bug #69693