1--TEST--
2all errors on negative scale
3--EXTENSIONS--
4bcmath
5--INI--
6bcmath.scale=0
7--FILE--
8<?php
9try {
10    bcadd('1','2',-1);
11} catch (\ValueError $e) {
12    echo $e->getMessage() . \PHP_EOL;
13}
14try {
15    bcsub('1','2',-1);
16} catch (\ValueError $e) {
17    echo $e->getMessage() . \PHP_EOL;
18}
19try {
20    bcmul('1','2',-1);
21} catch (\ValueError $e) {
22    echo $e->getMessage() . \PHP_EOL;
23}
24try {
25    bcdiv('1','2',-1);
26} catch (\ValueError $e) {
27    echo $e->getMessage() . \PHP_EOL;
28}
29try {
30    bcmod('1','2',-1);
31} catch (\ValueError $e) {
32    echo $e->getMessage() . \PHP_EOL;
33}
34try {
35    bcpowmod('1', '2', '3', -9);
36} catch (\ValueError $e) {
37    echo $e->getMessage() . \PHP_EOL;
38}
39try {
40    bcpow('1', '2', -1);
41} catch (\ValueError $e) {
42    echo $e->getMessage() . \PHP_EOL;
43}
44try {
45    bcsqrt('9', -1);
46} catch (\ValueError $e) {
47    echo $e->getMessage() . \PHP_EOL;
48}
49try {
50    bccomp('1', '2', -1);
51} catch (\ValueError $e) {
52    echo $e->getMessage() . \PHP_EOL;
53}
54try {
55    bcscale(-1);
56} catch (\ValueError $e) {
57    echo $e->getMessage() . \PHP_EOL;
58}
59?>
60--EXPECT--
61bcadd(): Argument #3 ($scale) must be between 0 and 2147483647
62bcsub(): Argument #3 ($scale) must be between 0 and 2147483647
63bcmul(): Argument #3 ($scale) must be between 0 and 2147483647
64bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647
65bcmod(): Argument #3 ($scale) must be between 0 and 2147483647
66bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647
67bcpow(): Argument #3 ($scale) must be between 0 and 2147483647
68bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647
69bccomp(): Argument #3 ($scale) must be between 0 and 2147483647
70bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
71