Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Fixed bug #44995 (bcpowmod() fails if scale != 0)
This commit is contained in:
Christoph M. Becker 2017-09-06 23:40:55 +02:00
commit 5ce744091c
3 changed files with 20 additions and 1 deletions

3
NEWS
View File

@ -6,6 +6,9 @@ PHP NEWS
. Fixed Bug #75142 (buildcheck.sh check for autoconf version needs to be updated
for v2.64). (zizzy at zizzy dot net, Remi)
- BCMath:
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
- CLI server:
. Fixed bug #70470 (Built-in server truncates headers spanning over TCP
packets). (bouk)

View File

@ -59,7 +59,7 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
bc_init_num(&temp);
/* Calculate it. */
bc_divide (num1, num2, &temp, scale);
bc_divide (num1, num2, &temp, 0);
if (quot)
quotient = bc_copy_num (temp);
bc_multiply (temp, num2, &temp, rscale);

View File

@ -0,0 +1,16 @@
--TEST--
Bug #44995 (bcpowmod() fails if scale != 0)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
?>
--FILE--
<?php
var_dump(bcpowmod('4', '4', '3', 1));
var_dump(bcpowmod('3234', '32345', '22345', 1));
?>
===DONE===
--EXPECT--
string(3) "1.0"
string(7) "17334.0"
===DONE===