From 57b1af3582abdb0eefc6d8e4b429d72e48f9fc37 Mon Sep 17 00:00:00 2001 From: NickSdot Date: Fri, 7 Aug 2026 15:15:30 +0000 Subject: [PATCH] ext/bcmath: applied fixers to improve test robustness --- ext/bcmath/tests/bcadd_error.phpt | 8 +-- ext/bcmath/tests/bcceil_error.phpt | 8 +-- ext/bcmath/tests/bccomp_error.phpt | 8 +-- ext/bcmath/tests/bcdiv_error1.phpt | 12 ++--- ext/bcmath/tests/bcdiv_error2.phpt | 8 +-- ext/bcmath/tests/bcfloor_error.phpt | 8 +-- ext/bcmath/tests/bcmod_error2.phpt | 12 ++--- ext/bcmath/tests/bcmod_error3.phpt | 8 +-- ext/bcmath/tests/bcmul_error.phpt | 8 +-- ext/bcmath/tests/bcpow_div_by_zero.phpt | 14 +++--- ext/bcmath/tests/bcpow_error1.phpt | 8 +-- ext/bcmath/tests/bcpow_error2.phpt | 8 +-- ext/bcmath/tests/bcpow_error3.phpt | 8 +-- ext/bcmath/tests/bcpowmod_error.phpt | 12 ++--- .../tests/bcpowmod_negative_exponent.phpt | 4 +- ext/bcmath/tests/bcpowmod_zero_modulus.phpt | 4 +- ext/bcmath/tests/bcround_error.phpt | 8 +-- .../tests/bcround_precision_bounds.phpt | 12 ++--- ext/bcmath/tests/bcscale_variation001.phpt | 6 +-- ext/bcmath/tests/bcsqrt_error1.phpt | 4 +- ext/bcmath/tests/bcsqrt_error2.phpt | 4 +- ext/bcmath/tests/bcsub_error.phpt | 8 +-- ext/bcmath/tests/bug60377.phpt | 4 +- ext/bcmath/tests/bug72093.phpt | 8 +-- ext/bcmath/tests/bug75178.phpt | 8 +-- ext/bcmath/tests/bug78878.phpt | 4 +- ext/bcmath/tests/bug80545.phpt | 8 +-- ext/bcmath/tests/gh15968.phpt | 4 +- ext/bcmath/tests/negative_scale.phpt | 40 +++++++-------- ext/bcmath/tests/number/construct_error.phpt | 8 +-- .../methods/calc_methods_num_arg_error.phpt | 46 ++++++++--------- .../methods/calc_methods_scale_arg_error.phpt | 26 +++++----- .../number/methods/compare_arg_error.phpt | 8 +-- .../tests/number/methods/pow_div_by_zero.phpt | 14 +++--- .../number/methods/powmod_arg_error.phpt | 20 ++++---- .../tests/number/operators/calc_array.phpt | 24 ++++----- .../operators/calc_non_numeric_string.phpt | 24 ++++----- .../tests/number/operators/calc_null.phpt | 24 ++++----- .../number/operators/calc_other_class.phpt | 24 ++++----- .../tests/number/operators/calc_undef.phpt | 24 ++++----- .../tests/number/operators/div_by_zero.phpt | 24 ++++----- .../tests/number/operators/mod_by_zero.phpt | 24 ++++----- .../number/operators/pow_div_by_zero.phpt | 14 +++--- .../tests/number/properties_unknown.phpt | 8 +-- ext/bcmath/tests/number/properties_unset.phpt | 8 +-- .../tests/number/properties_write_error.phpt | 8 +-- .../tests/number/unserialize_error.phpt | 14 +++--- .../tests/sec_embedded_null_truncation.phpt | 50 +++++++++---------- ext/bcmath/tests/str2num_formatting.phpt | 44 ++++++++-------- 49 files changed, 346 insertions(+), 346 deletions(-) diff --git a/ext/bcmath/tests/bcadd_error.phpt b/ext/bcmath/tests/bcadd_error.phpt index 320bf390680a..ffd3ba429b03 100644 --- a/ext/bcmath/tests/bcadd_error.phpt +++ b/ext/bcmath/tests/bcadd_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcadd('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcadd('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #2 ($num2) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcceil_error.phpt b/ext/bcmath/tests/bcceil_error.phpt index fd4c51ff6c58..58df0fdce601 100644 --- a/ext/bcmath/tests/bcceil_error.phpt +++ b/ext/bcmath/tests/bcceil_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcceil('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcceil('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcceil(): Argument #1 ($num) is not well-formed -bcceil(): Argument #1 ($num) is not well-formed +ValueError: bcceil(): Argument #1 ($num) is not well-formed +ValueError: bcceil(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bccomp_error.phpt b/ext/bcmath/tests/bccomp_error.phpt index 90645c52f7e5..5a48f4e0494d 100644 --- a/ext/bcmath/tests/bccomp_error.phpt +++ b/ext/bcmath/tests/bccomp_error.phpt @@ -8,16 +8,16 @@ bcmath try { bccomp('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bccomp('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #2 ($num2) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcdiv_error1.phpt b/ext/bcmath/tests/bcdiv_error1.phpt index b6af64d69af3..fbb37ad66931 100644 --- a/ext/bcmath/tests/bcdiv_error1.phpt +++ b/ext/bcmath/tests/bcdiv_error1.phpt @@ -11,22 +11,22 @@ bcmath try { bcdiv('10.99', '0'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcdiv('10.99', '0.00'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcdiv('10.99', '-0.00'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Division by zero -Division by zero -Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/bcmath/tests/bcdiv_error2.phpt b/ext/bcmath/tests/bcdiv_error2.phpt index a4e1cae35354..fb21fca2eedd 100644 --- a/ext/bcmath/tests/bcdiv_error2.phpt +++ b/ext/bcmath/tests/bcdiv_error2.phpt @@ -8,16 +8,16 @@ bcmath try { bcdiv('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcdiv('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcdiv(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #2 ($num2) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcfloor_error.phpt b/ext/bcmath/tests/bcfloor_error.phpt index 7578a5afe3b8..28556b366aaa 100644 --- a/ext/bcmath/tests/bcfloor_error.phpt +++ b/ext/bcmath/tests/bcfloor_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcfloor('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcfloor('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcfloor(): Argument #1 ($num) is not well-formed -bcfloor(): Argument #1 ($num) is not well-formed +ValueError: bcfloor(): Argument #1 ($num) is not well-formed +ValueError: bcfloor(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcmod_error2.phpt b/ext/bcmath/tests/bcmod_error2.phpt index 37c433fbb89c..27e724282df2 100644 --- a/ext/bcmath/tests/bcmod_error2.phpt +++ b/ext/bcmath/tests/bcmod_error2.phpt @@ -9,20 +9,20 @@ bcmath.scale=0 try { bcmod("10", "0"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcmod("10", "0.000"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcmod("10", "-0.0"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Modulo by zero -Modulo by zero -Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/bcmod_error3.phpt b/ext/bcmath/tests/bcmod_error3.phpt index 8df986fe7654..d15c91700578 100644 --- a/ext/bcmath/tests/bcmod_error3.phpt +++ b/ext/bcmath/tests/bcmod_error3.phpt @@ -8,16 +8,16 @@ bcmath try { bcmod('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmod('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcmod(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #2 ($num2) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcmul_error.phpt b/ext/bcmath/tests/bcmul_error.phpt index 361b46163ee6..5ba15027e44c 100644 --- a/ext/bcmath/tests/bcmul_error.phpt +++ b/ext/bcmath/tests/bcmul_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcmul('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmul('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcmul(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #2 ($num2) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcpow_div_by_zero.phpt b/ext/bcmath/tests/bcpow_div_by_zero.phpt index ac1e8187450c..fa5d97698d99 100644 --- a/ext/bcmath/tests/bcpow_div_by_zero.phpt +++ b/ext/bcmath/tests/bcpow_div_by_zero.phpt @@ -14,16 +14,16 @@ foreach ($baseNumbers as $baseNumber) { try { echo bcpow($baseNumber, $exponent), "\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/bcpow_error1.phpt b/ext/bcmath/tests/bcpow_error1.phpt index fefdfc57a010..1f991deb4dfa 100644 --- a/ext/bcmath/tests/bcpow_error1.phpt +++ b/ext/bcmath/tests/bcpow_error1.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpow('1', '1.1', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpow('1', '0.1', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #2 ($exponent) cannot have a fractional part -bcpow(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part diff --git a/ext/bcmath/tests/bcpow_error2.phpt b/ext/bcmath/tests/bcpow_error2.phpt index f9b830ca7d5b..ac4b995201a9 100644 --- a/ext/bcmath/tests/bcpow_error2.phpt +++ b/ext/bcmath/tests/bcpow_error2.phpt @@ -7,15 +7,15 @@ bcmath try { var_dump(bcpow('0', '9223372036854775808', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpow('0', '-9223372036854775808', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #2 ($exponent) is too large -bcpow(): Argument #2 ($exponent) is too large +ValueError: bcpow(): Argument #2 ($exponent) is too large +ValueError: bcpow(): Argument #2 ($exponent) is too large diff --git a/ext/bcmath/tests/bcpow_error3.phpt b/ext/bcmath/tests/bcpow_error3.phpt index f47c85d4da86..941d2f7fae9f 100644 --- a/ext/bcmath/tests/bcpow_error3.phpt +++ b/ext/bcmath/tests/bcpow_error3.phpt @@ -8,16 +8,16 @@ bcmath try { bcpow('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpow('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #1 ($num) is not well-formed -bcpow(): Argument #2 ($exponent) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bcpow(): Argument #2 ($exponent) is not well-formed diff --git a/ext/bcmath/tests/bcpowmod_error.phpt b/ext/bcmath/tests/bcpowmod_error.phpt index ff2862310cb2..9b9770a959d7 100644 --- a/ext/bcmath/tests/bcpowmod_error.phpt +++ b/ext/bcmath/tests/bcpowmod_error.phpt @@ -8,23 +8,23 @@ bcmath try { bcpowmod('a', '1', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', 'a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', '1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #1 ($num) is not well-formed -bcpowmod(): Argument #2 ($exponent) is not well-formed -bcpowmod(): Argument #3 ($modulus) is not well-formed +ValueError: bcpowmod(): Argument #1 ($num) is not well-formed +ValueError: bcpowmod(): Argument #2 ($exponent) is not well-formed +ValueError: bcpowmod(): Argument #3 ($modulus) is not well-formed diff --git a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt index 7814e2bd41d8..61b60ff60234 100644 --- a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt +++ b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt @@ -9,8 +9,8 @@ bcmath try { var_dump(bcpowmod('1', '-1', '2')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0 +ValueError: bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0 diff --git a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt index 8540a0d6df3c..833a55266e3e 100644 --- a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt +++ b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt @@ -9,8 +9,8 @@ bcmath try { var_dump(bcpowmod('1', '1', '0')); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/bcround_error.phpt b/ext/bcmath/tests/bcround_error.phpt index 95579a4edf09..fe114cf8bba6 100644 --- a/ext/bcmath/tests/bcround_error.phpt +++ b/ext/bcmath/tests/bcround_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcround('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcround('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcround(): Argument #1 ($num) is not well-formed -bcround(): Argument #1 ($num) is not well-formed +ValueError: bcround(): Argument #1 ($num) is not well-formed +ValueError: bcround(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcround_precision_bounds.phpt b/ext/bcmath/tests/bcround_precision_bounds.phpt index 4c4f910476a7..fcfb2d2c3248 100644 --- a/ext/bcmath/tests/bcround_precision_bounds.phpt +++ b/ext/bcmath/tests/bcround_precision_bounds.phpt @@ -9,20 +9,20 @@ bcmath try { bcround('1', PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { (new BcMath\Number('1'))->round(PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { (new BcMath\Number('1'))->round(2147483648); // INT_MAX + 1 } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -bcround(): Argument #2 ($precision) must be between %i and %d -BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d -BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d +ValueError: bcround(): Argument #2 ($precision) must be between %i and %d +ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d +ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d diff --git a/ext/bcmath/tests/bcscale_variation001.phpt b/ext/bcmath/tests/bcscale_variation001.phpt index 8d9d32e064b8..ce51029e4b68 100644 --- a/ext/bcmath/tests/bcscale_variation001.phpt +++ b/ext/bcmath/tests/bcscale_variation001.phpt @@ -6,13 +6,13 @@ bcmath bcmath.scale=0 --FILE-- getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- 5 -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/bcsqrt_error1.phpt b/ext/bcmath/tests/bcsqrt_error1.phpt index 78923f4a9480..9d265d8c76c2 100644 --- a/ext/bcmath/tests/bcsqrt_error1.phpt +++ b/ext/bcmath/tests/bcsqrt_error1.phpt @@ -10,8 +10,8 @@ bcmath try { bcsqrt('-9'); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsqrt(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: bcsqrt(): Argument #1 ($num) must be greater than or equal to 0 diff --git a/ext/bcmath/tests/bcsqrt_error2.phpt b/ext/bcmath/tests/bcsqrt_error2.phpt index 1ef934d3bcf1..0e49714db29d 100644 --- a/ext/bcmath/tests/bcsqrt_error2.phpt +++ b/ext/bcmath/tests/bcsqrt_error2.phpt @@ -8,9 +8,9 @@ bcmath try { bcsqrt('a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcsub_error.phpt b/ext/bcmath/tests/bcsub_error.phpt index 4e1abd3fa950..0e04cffafde6 100644 --- a/ext/bcmath/tests/bcsub_error.phpt +++ b/ext/bcmath/tests/bcsub_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcsub('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsub('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsub(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #2 ($num2) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt index 16d058441a35..46aa59fdb265 100644 --- a/ext/bcmath/tests/bug60377.phpt +++ b/ext/bcmath/tests/bug60377.phpt @@ -10,10 +10,10 @@ if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?> try { $var48 = bcscale(634314234334311); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $var67 = bcsqrt(0); $var414 = bcadd(0,-1,10); ?> --EXPECT-- -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/bug72093.phpt b/ext/bcmath/tests/bug72093.phpt index a424a59e0470..c88afacedea4 100644 --- a/ext/bcmath/tests/bug72093.phpt +++ b/ext/bcmath/tests/bug72093.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpowmod(1, 0, 128, -200)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpowmod(1, 1.2, 1, 1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 -bcpowmod(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 +ValueError: bcpowmod(): Argument #2 ($exponent) cannot have a fractional part diff --git a/ext/bcmath/tests/bug75178.phpt b/ext/bcmath/tests/bug75178.phpt index 940a3567de16..14d627bada03 100644 --- a/ext/bcmath/tests/bug75178.phpt +++ b/ext/bcmath/tests/bug75178.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpowmod('4.1', '4', '3', 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpowmod('4', '4', '3.1', 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #1 ($num) cannot have a fractional part -bcpowmod(): Argument #3 ($modulus) cannot have a fractional part +ValueError: bcpowmod(): Argument #1 ($num) cannot have a fractional part +ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part diff --git a/ext/bcmath/tests/bug78878.phpt b/ext/bcmath/tests/bug78878.phpt index 9d9d0db48cf4..1ba4376cd7dd 100644 --- a/ext/bcmath/tests/bug78878.phpt +++ b/ext/bcmath/tests/bug78878.phpt @@ -7,8 +7,8 @@ bcmath try { print bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #3 ($modulus) cannot have a fractional part +ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part diff --git a/ext/bcmath/tests/bug80545.phpt b/ext/bcmath/tests/bug80545.phpt index f1e256776d93..ca795e01d0dc 100644 --- a/ext/bcmath/tests/bug80545.phpt +++ b/ext/bcmath/tests/bug80545.phpt @@ -8,16 +8,16 @@ bcmath try { bcadd('a', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcadd('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #2 ($num2) is not well-formed \ No newline at end of file +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/gh15968.phpt b/ext/bcmath/tests/gh15968.phpt index aa91534e7738..ddf112412785 100644 --- a/ext/bcmath/tests/gh15968.phpt +++ b/ext/bcmath/tests/gh15968.phpt @@ -15,8 +15,8 @@ $b = new MyString(); try { var_dump($a + $b); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + MyString +TypeError: Unsupported operand types: BcMath\Number + MyString diff --git a/ext/bcmath/tests/negative_scale.phpt b/ext/bcmath/tests/negative_scale.phpt index 3b9377559098..ed3d726f6ec3 100644 --- a/ext/bcmath/tests/negative_scale.phpt +++ b/ext/bcmath/tests/negative_scale.phpt @@ -9,62 +9,62 @@ bcmath.scale=0 try { bcadd('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsub('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmul('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcdiv('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmod('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', '2', '3', -9); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpow('1', '2', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsqrt('9', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bccomp('1', '2', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcscale(-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #3 ($scale) must be between 0 and 2147483647 -bcsub(): Argument #3 ($scale) must be between 0 and 2147483647 -bcmul(): Argument #3 ($scale) must be between 0 and 2147483647 -bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647 -bcmod(): Argument #3 ($scale) must be between 0 and 2147483647 -bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 -bcpow(): Argument #3 ($scale) must be between 0 and 2147483647 -bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647 -bccomp(): Argument #3 ($scale) must be between 0 and 2147483647 -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcadd(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcsub(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcmul(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcmod(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 +ValueError: bcpow(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647 +ValueError: bccomp(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/number/construct_error.phpt b/ext/bcmath/tests/number/construct_error.phpt index 0b49e871cea9..f2113f1c44a2 100644 --- a/ext/bcmath/tests/number/construct_error.phpt +++ b/ext/bcmath/tests/number/construct_error.phpt @@ -8,16 +8,16 @@ try { $num = new BcMath\Number('1'); $num->__construct(5); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num = new BcMath\Number('a'); var_dump($num); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value -BcMath\Number::__construct(): Argument #1 ($num) is not well-formed +Error: Cannot modify readonly property BcMath\Number::$value +ValueError: BcMath\Number::__construct(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt index 7f64f3101139..f4935762383c 100644 --- a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt @@ -29,7 +29,7 @@ foreach ($methods as $method) { try { $num->$method($val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "\n"; @@ -38,11 +38,11 @@ foreach ($methods as $method) { --EXPECTF-- ========== add ========== non number str: -BcMath\Number::add(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::add(): Argument #1 ($num) is not well-formed array: -BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -52,11 +52,11 @@ Deprecated: BcMath\Number::add(): Passing null to parameter #1 ($num) of type Bc ========== sub ========== non number str: -BcMath\Number::sub(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::sub(): Argument #1 ($num) is not well-formed array: -BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -66,11 +66,11 @@ Deprecated: BcMath\Number::sub(): Passing null to parameter #1 ($num) of type Bc ========== mul ========== non number str: -BcMath\Number::mul(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::mul(): Argument #1 ($num) is not well-formed array: -BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -80,43 +80,43 @@ Deprecated: BcMath\Number::mul(): Passing null to parameter #1 ($num) of type Bc ========== div ========== non number str: -BcMath\Number::div(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::div(): Argument #1 ($num) is not well-formed array: -BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Division by zero +DivisionByZeroError: Division by zero null: Deprecated: BcMath\Number::div(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s -Division by zero +DivisionByZeroError: Division by zero ========== mod ========== non number str: -BcMath\Number::mod(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::mod(): Argument #1 ($num) is not well-formed array: -BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Modulo by zero +DivisionByZeroError: Modulo by zero null: Deprecated: BcMath\Number::mod(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s -Modulo by zero +DivisionByZeroError: Modulo by zero ========== pow ========== non number str: -BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed +ValueError: BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed array: -BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s diff --git a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt index 35e789f9c103..bce9ecebdf99 100644 --- a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt @@ -27,7 +27,7 @@ foreach ($methods as $method) { try { $num->$method(1, $val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "\n"; @@ -36,54 +36,54 @@ foreach ($methods as $method) { --EXPECTF-- ========== add ========== array: -BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== sub ========== array: -BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== mul ========== array: -BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== div ========== array: -BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== mod ========== array: -BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== pow ========== array: -BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s diff --git a/ext/bcmath/tests/number/methods/compare_arg_error.phpt b/ext/bcmath/tests/number/methods/compare_arg_error.phpt index bf714304d7fd..ff752d3d36e5 100644 --- a/ext/bcmath/tests/number/methods/compare_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/compare_arg_error.phpt @@ -18,20 +18,20 @@ foreach ($args as [$val, $type]) { try { $num->compare($val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } ?> --EXPECTF-- non number str: -BcMath\Number::compare(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::compare(): Argument #1 ($num) is not well-formed array: -BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: diff --git a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt index 6a7099b1c30e..565fd65bf136 100644 --- a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt +++ b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt @@ -21,21 +21,21 @@ foreach ($values as $value) { try { $num->pow($exponent); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt index 796769e1e6c4..923bd9968b61 100644 --- a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt @@ -20,7 +20,7 @@ foreach ($args as [$val, $type]) { try { $num->powmod($val, 1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -32,18 +32,18 @@ foreach ($args as [$val, $type]) { try { $num->powmod(1, $val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- ========== check 1st arg ========== non number str: -BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed +ValueError: BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed array: -BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -53,16 +53,16 @@ Deprecated: BcMath\Number::powmod(): Passing null to parameter #1 ($exponent) of ========== check 2nd arg ========== non number str: -BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed +ValueError: BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed array: -BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Modulo by zero +DivisionByZeroError: Modulo by zero null: Deprecated: BcMath\Number::powmod(): Passing null to parameter #2 ($modulus) of type BcMath\Number|string|int is deprecated in %s -Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/number/operators/calc_array.phpt b/ext/bcmath/tests/number/operators/calc_array.phpt index 31acfb3ad118..b1322de040d0 100644 --- a/ext/bcmath/tests/number/operators/calc_array.phpt +++ b/ext/bcmath/tests/number/operators/calc_array.phpt @@ -10,43 +10,43 @@ $array = [1]; try { $num + $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + array -Unsupported operand types: BcMath\Number - array -Unsupported operand types: BcMath\Number * array -Unsupported operand types: BcMath\Number / array -Unsupported operand types: BcMath\Number % array -Unsupported operand types: BcMath\Number ** array +TypeError: Unsupported operand types: BcMath\Number + array +TypeError: Unsupported operand types: BcMath\Number - array +TypeError: Unsupported operand types: BcMath\Number * array +TypeError: Unsupported operand types: BcMath\Number / array +TypeError: Unsupported operand types: BcMath\Number % array +TypeError: Unsupported operand types: BcMath\Number ** array diff --git a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt index d9fe499d921d..05720638f7eb 100644 --- a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt +++ b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt @@ -9,43 +9,43 @@ $num = new BcMath\Number(100); try { $num + 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number diff --git a/ext/bcmath/tests/number/operators/calc_null.phpt b/ext/bcmath/tests/number/operators/calc_null.phpt index a5745dc5e762..301ec7c70dce 100644 --- a/ext/bcmath/tests/number/operators/calc_null.phpt +++ b/ext/bcmath/tests/number/operators/calc_null.phpt @@ -9,43 +9,43 @@ $num = new BcMath\Number(100); try { $num + null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + null -Unsupported operand types: BcMath\Number - null -Unsupported operand types: BcMath\Number * null -Unsupported operand types: BcMath\Number / null -Unsupported operand types: BcMath\Number % null -Unsupported operand types: BcMath\Number ** null +TypeError: Unsupported operand types: BcMath\Number + null +TypeError: Unsupported operand types: BcMath\Number - null +TypeError: Unsupported operand types: BcMath\Number * null +TypeError: Unsupported operand types: BcMath\Number / null +TypeError: Unsupported operand types: BcMath\Number % null +TypeError: Unsupported operand types: BcMath\Number ** null diff --git a/ext/bcmath/tests/number/operators/calc_other_class.phpt b/ext/bcmath/tests/number/operators/calc_other_class.phpt index 5c6a11747def..2c43340feac7 100644 --- a/ext/bcmath/tests/number/operators/calc_other_class.phpt +++ b/ext/bcmath/tests/number/operators/calc_other_class.phpt @@ -10,43 +10,43 @@ $other = new stdClass(); try { $num + $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + stdClass -Unsupported operand types: BcMath\Number - stdClass -Unsupported operand types: BcMath\Number * stdClass -Unsupported operand types: BcMath\Number / stdClass -Unsupported operand types: BcMath\Number % stdClass -Unsupported operand types: BcMath\Number ** stdClass +TypeError: Unsupported operand types: BcMath\Number + stdClass +TypeError: Unsupported operand types: BcMath\Number - stdClass +TypeError: Unsupported operand types: BcMath\Number * stdClass +TypeError: Unsupported operand types: BcMath\Number / stdClass +TypeError: Unsupported operand types: BcMath\Number % stdClass +TypeError: Unsupported operand types: BcMath\Number ** stdClass diff --git a/ext/bcmath/tests/number/operators/calc_undef.phpt b/ext/bcmath/tests/number/operators/calc_undef.phpt index f7b188a8d211..fdde7613cdd0 100644 --- a/ext/bcmath/tests/number/operators/calc_undef.phpt +++ b/ext/bcmath/tests/number/operators/calc_undef.phpt @@ -9,54 +9,54 @@ $num = new BcMath\Number(100); try { $num + $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number + null +TypeError: Unsupported operand types: BcMath\Number + null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number - null +TypeError: Unsupported operand types: BcMath\Number - null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number * null +TypeError: Unsupported operand types: BcMath\Number * null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number / null +TypeError: Unsupported operand types: BcMath\Number / null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number % null +TypeError: Unsupported operand types: BcMath\Number % null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number ** null +TypeError: Unsupported operand types: BcMath\Number ** null diff --git a/ext/bcmath/tests/number/operators/div_by_zero.phpt b/ext/bcmath/tests/number/operators/div_by_zero.phpt index cadac7361a2f..684cc133fa28 100644 --- a/ext/bcmath/tests/number/operators/div_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/div_by_zero.phpt @@ -9,19 +9,19 @@ $num = new BcMath\Number(100); try { $num / 0; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / '0'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / (new BcMath\Number(0)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $zero = new BcMath\Number(0); @@ -29,25 +29,25 @@ $zero = new BcMath\Number(0); try { 100 / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { '100' / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Division by zero -Division by zero -Division by zero -Division by zero -Division by zero -Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/bcmath/tests/number/operators/mod_by_zero.phpt b/ext/bcmath/tests/number/operators/mod_by_zero.phpt index 9c1e08f6a4dc..56382255e0f7 100644 --- a/ext/bcmath/tests/number/operators/mod_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/mod_by_zero.phpt @@ -9,19 +9,19 @@ $num = new BcMath\Number(100); try { $num % 0; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % '0'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % (new BcMath\Number(0)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $zero = new BcMath\Number(0); @@ -29,25 +29,25 @@ $zero = new BcMath\Number(0); try { 100 % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { '100' % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt index ff03626fca60..aa0f32de49f8 100644 --- a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt @@ -21,21 +21,21 @@ foreach ($values as $value) { try { $num ** $exponent; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/number/properties_unknown.phpt b/ext/bcmath/tests/number/properties_unknown.phpt index cd1c13eb0c74..9a9bc6c461a9 100644 --- a/ext/bcmath/tests/number/properties_unknown.phpt +++ b/ext/bcmath/tests/number/properties_unknown.phpt @@ -12,7 +12,7 @@ var_dump($num->foo); try { $num->foo = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($num->foo); @@ -20,7 +20,7 @@ var_dump($num->foo); try { $num->bar = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($num->foo)); @@ -28,9 +28,9 @@ var_dump(isset($num->foo)); --EXPECTF-- Warning: Undefined property: BcMath\Number::$foo in %s NULL -Cannot create dynamic property BcMath\Number::$foo +Error: Cannot create dynamic property BcMath\Number::$foo Warning: Undefined property: BcMath\Number::$foo in %s NULL -Cannot create dynamic property BcMath\Number::$bar +Error: Cannot create dynamic property BcMath\Number::$bar bool(false) diff --git a/ext/bcmath/tests/number/properties_unset.phpt b/ext/bcmath/tests/number/properties_unset.phpt index ce21350240bb..052764b10d38 100644 --- a/ext/bcmath/tests/number/properties_unset.phpt +++ b/ext/bcmath/tests/number/properties_unset.phpt @@ -9,15 +9,15 @@ $num = new BcMath\Number(1); try { unset($num->value); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($num->scale); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset readonly property BcMath\Number::$value -Cannot unset readonly property BcMath\Number::$scale +Error: Cannot unset readonly property BcMath\Number::$value +Error: Cannot unset readonly property BcMath\Number::$scale diff --git a/ext/bcmath/tests/number/properties_write_error.phpt b/ext/bcmath/tests/number/properties_write_error.phpt index 03683c4c0926..673bddd8c6ac 100644 --- a/ext/bcmath/tests/number/properties_write_error.phpt +++ b/ext/bcmath/tests/number/properties_write_error.phpt @@ -9,15 +9,15 @@ $num = new BcMath\Number(1); try { $num->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num->scale = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value -Cannot modify readonly property BcMath\Number::$scale +Error: Cannot modify readonly property BcMath\Number::$value +Error: Cannot modify readonly property BcMath\Number::$scale diff --git a/ext/bcmath/tests/number/unserialize_error.phpt b/ext/bcmath/tests/number/unserialize_error.phpt index 030ba1232d06..f0338f62fb64 100644 --- a/ext/bcmath/tests/number/unserialize_error.phpt +++ b/ext/bcmath/tests/number/unserialize_error.phpt @@ -8,7 +8,7 @@ try { $num = new BcMath\Number(1); $num->__unserialize(['value' => '5']); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -23,14 +23,14 @@ foreach ($cases as $case) { try { unserialize($case); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value +Error: Cannot modify readonly property BcMath\Number::$value -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object diff --git a/ext/bcmath/tests/sec_embedded_null_truncation.phpt b/ext/bcmath/tests/sec_embedded_null_truncation.phpt index 157810ecbb3a..8606abd6aa3a 100644 --- a/ext/bcmath/tests/sec_embedded_null_truncation.phpt +++ b/ext/bcmath/tests/sec_embedded_null_truncation.phpt @@ -27,33 +27,33 @@ foreach ($cases as $s) { $fn($s); echo "FAIL: accepted\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/str2num_formatting.phpt b/ext/bcmath/tests/str2num_formatting.phpt index 4b77381de868..61c81b17ca6b 100644 --- a/ext/bcmath/tests/str2num_formatting.phpt +++ b/ext/bcmath/tests/str2num_formatting.phpt @@ -19,37 +19,37 @@ echo "\n"; try { echo bcadd(" 0", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1e1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1,1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("Hello", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1 1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1.a", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n"; @@ -65,31 +65,31 @@ echo "\n"; try { echo bccomp(" 0", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1e1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1,1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("Hello", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1 1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -100,12 +100,12 @@ try { 2 2 -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed -1 -1 @@ -113,8 +113,8 @@ bcadd(): Argument #1 ($num1) is not well-formed -1 -1 -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed