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
|
2016-04-25 01:33:32 +00:00
|
|
|
--SKIPIF--
|
2016-04-27 11:16:57 +00:00
|
|
|
<?php
|
|
|
|
if(!extension_loaded("bcmath")) print "skip";
|
|
|
|
?>
|
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;
|
|
|
|
}
|
2016-04-25 01:33:32 +00:00
|
|
|
var_dump(bcpowmod(1, 1.2, 1, 1));
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2020-04-24 23:18:09 +00:00
|
|
|
bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
|
2017-09-09 21:57:22 +00:00
|
|
|
|
2020-01-15 10:27:29 +00:00
|
|
|
Warning: bcpowmod(): Non-zero scale in exponent in %s on line %d
|
2016-04-25 01:33:32 +00:00
|
|
|
string(3) "0.0"
|