xref: /PHP-8.3/ext/bcmath/tests/bcmod_error2.phpt (revision ee226128)
1--TEST--
2bcmod() - mod by 0
3--EXTENSIONS--
4bcmath
5--INI--
6bcmath.scale=0
7--FILE--
8<?php
9try {
10    bcmod("10", "0");
11} catch (DivisionByZeroError $ex) {
12    echo $ex->getMessage(), PHP_EOL;
13}
14try {
15    bcmod("10", "0.000");
16} catch (DivisionByZeroError $ex) {
17    echo $ex->getMessage(), PHP_EOL;
18}
19try {
20    bcmod("10", "-0.0");
21} catch (DivisionByZeroError $ex) {
22    echo $ex->getMessage(), PHP_EOL;
23}
24?>
25--EXPECT--
26Modulo by zero
27Modulo by zero
28Modulo by zero
29