. count() now raises a warning when an invalid parameter is passed.
Only arrays and objects implementing the Countable interface should be passed.
. pack() and unpack() now support float and double in both little and big endian.
+ . number_format() ensures zero values never contain a negative sign.
- XML:
. utf8_encode() and utf8_decode() have been moved to the Standard extension
return tmpbuf;
}
+ /* Check if the number is no longer negative after rounding */
+ if (is_negative && d == 0) {
+ is_negative = 0;
+ }
+
/* find decimal point, if expected */
if (dec) {
dp = strpbrk(ZSTR_VAL(tmpbuf), ".,");
--- /dev/null
+--TEST--
+Prevent number_format from returning negative zero
+--FILE--
+<?php
+
+$number = -1.15E-15;
+
+var_dump($number);
+var_dump(number_format($number, 2));
+var_dump(number_format(-0.01, 2));
+
+?>
+--EXPECT--
+float(-1.15E-15)
+string(4) "0.00"
+string(5) "-0.01"