xref: /PHP-8.1/ext/bcmath/tests/bug75178.phpt (revision 56f90492)
1--TEST--
2Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
3--EXTENSIONS--
4bcmath
5--FILE--
6<?php
7try {
8    var_dump(bcpowmod('4.1', '4', '3', 3));
9} catch (\ValueError $e) {
10    echo $e->getMessage() . \PHP_EOL;
11}
12try {
13    var_dump(bcpowmod('4', '4', '3.1', 3));
14} catch (\ValueError $e) {
15    echo $e->getMessage() . \PHP_EOL;
16}
17?>
18--EXPECT--
19bcpowmod(): Argument #1 ($num) cannot have a fractional part
20bcpowmod(): Argument #3 ($modulus) cannot have a fractional part
21