1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00
Files
archived-php-src/ext/bcmath/tests/bug72093.phpt
George Peter Banyard cd05b56a6f Promote some warnings in BCMath to Errors
Also do a bit of refactoring at the same time.

Closes GH-6105
2020-09-11 17:40:06 +02:00

23 lines
535 B
PHP

--TEST--
Bug 72093: bcpowmod fails on negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
?>
--FILE--
<?php
try {
var_dump(bcpowmod(1, 0, 128, -200));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(bcpowmod(1, 1.2, 1, 1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
bcpowmod(): Argument #2 ($exponent) cannot have a fractional part