xref: /PHP-8.0/ext/bcmath/tests/bug80545.phpt (revision 94a151a0)
1--TEST--
2Bug #80545 (bcadd('a', 'a') and bcadd('1', 'a') doesn't throw an exception)
3--SKIPIF--
4<?php
5if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
6?>
7--FILE--
8<?php
9
10try {
11    bcadd('a', 'a');
12} catch (\ValueError $e) {
13    echo $e->getMessage() . PHP_EOL;
14}
15
16try {
17    bcadd('1', 'a');
18} catch (\ValueError $e) {
19    echo $e->getMessage();
20}
21
22?>
23--EXPECT--
24bcadd(): Argument #1 ($num1) is not well-formed
25bcadd(): Argument #2 ($num2) is not well-formed