2016-04-25 01:33:32 +00:00
|
|
|
--TEST--
|
2020-04-24 23:18:09 +00:00
|
|
|
Bug 72093: bcpowmod fails on negative scale and corrupts _one_ definition
|
2021-03-22 13:10:15 +00:00
|
|
|
--EXTENSIONS--
|
|
|
|
bcmath
|
2016-04-25 01:33:32 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2020-04-24 23:18:09 +00:00
|
|
|
try {
|
|
|
|
var_dump(bcpowmod(1, 0, 128, -200));
|
|
|
|
} catch (\ValueError $e) {
|
|
|
|
echo $e->getMessage() . \PHP_EOL;
|
|
|
|
}
|
2020-09-11 15:40:06 +00:00
|
|
|
try {
|
|
|
|
var_dump(bcpowmod(1, 1.2, 1, 1));
|
|
|
|
} catch (\ValueError $e) {
|
|
|
|
echo $e->getMessage() . \PHP_EOL;
|
|
|
|
}
|
2016-04-25 01:33:32 +00:00
|
|
|
?>
|
2020-09-11 15:40:06 +00:00
|
|
|
--EXPECT--
|
2020-04-24 23:18:09 +00:00
|
|
|
bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
|
2020-09-11 15:40:06 +00:00
|
|
|
bcpowmod(): Argument #2 ($exponent) cannot have a fractional part
|