xref: /php-src/ext/bcmath/tests/bug72093.phpt (revision 56f90492)
1--TEST--
2Bug 72093: bcpowmod fails on negative scale and corrupts _one_ definition
3--EXTENSIONS--
4bcmath
5--FILE--
6<?php
7try {
8    var_dump(bcpowmod(1, 0, 128, -200));
9} catch (\ValueError $e) {
10    echo $e->getMessage() . \PHP_EOL;
11}
12try {
13    var_dump(bcpowmod(1, 1.2, 1, 1));
14} catch (\ValueError $e) {
15    echo $e->getMessage() . \PHP_EOL;
16}
17?>
18--EXPECT--
19bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
20bcpowmod(): Argument #2 ($exponent) cannot have a fractional part
21