php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65304
Patch bug65304.patch revision 2013-07-21 12:11 UTC by laruence@php.net

Patch bug65304.patch for Arrays related Bug #65304

Patch version 2013-07-21 12:11 UTC

Return to Bug #65304 | Download this patch
Patch Revisions:

Developer: laruence@php.net

diff --git a/ext/standard/array.c b/ext/standard/array.c
index e218dc0..0eaca16 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -4037,17 +4037,7 @@ PHP_FUNCTION(array_sum)
 		entry_n = **entry;
 		zval_copy_ctor(&entry_n);
 		convert_scalar_to_number(&entry_n TSRMLS_CC);
-
-		if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) {
-			dval = (double)Z_LVAL_P(return_value) + (double)Z_LVAL(entry_n);
-			if ( (double)LONG_MIN <= dval && dval <= (double)LONG_MAX ) {
-				Z_LVAL_P(return_value) += Z_LVAL(entry_n);
-				continue;
-			}
-		}
-		convert_to_double(return_value);
-		convert_to_double(&entry_n);
-		Z_DVAL_P(return_value) += Z_DVAL(entry_n);
+		fast_add_function(return_value, return_value, &entry_n TSRMLS_CC);
 	}
 }
 /* }}} */
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 19:02:26 2014 UTC