summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2016-08-17 16:34:22 +0200
committerKalle Sommer Nielsen <kalle@php.net>2016-08-17 16:34:22 +0200
commit1e4cae28b2ea2de9fb296366ea506cbb49c87452 (patch)
treef02e99f14fd5f850a8a68ed52018df4cfc1e0b67
parent8a1fbdda43ed3b36b9331aee1eaace3d961caee9 (diff)
downloadphp-git-1e4cae28b2ea2de9fb296366ea506cbb49c87452.tar.gz
Seems like I did a bad merge earlier, this should make PHP-7.0 sync with 7.1/master properly now
-rw-r--r--ext/standard/array.c3
-rw-r--r--ext/standard/php_math.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 538460bdcc..fbbf3cf078 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -45,6 +45,7 @@
#include "basic_functions.h"
#include "php_string.h"
#include "php_rand.h"
+#include "php_math.h"
#include "zend_smart_str.h"
#ifdef HAVE_SPL
#include "ext/spl/spl_array.h"
@@ -2106,7 +2107,7 @@ PHP_FUNCTION(array_fill_keys)
php_error_docref(NULL, E_WARNING, "The supplied range exceeds the maximum array size: start=%0.0f end=%0.0f", end, start); \
RETURN_FALSE; \
} \
- size = (uint32_t)round(__calc_size); \
+ size = (uint32_t)_php_math_round(__calc_size, 0, PHP_ROUND_HALF_UP); \
array_init_size(return_value, size); \
zend_hash_real_init(Z_ARRVAL_P(return_value), 1); \
} while (0)
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 406fd49dcd..62c089bf48 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -22,6 +22,7 @@
#ifndef PHP_MATH_H
#define PHP_MATH_H
+PHPAPI double _php_math_round(double, int, int);
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);