-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This converts the remaining "non well-formed" warnings in bcmath to ValueErrors, in line with the other warning promotions that have been performed in this extension. Closes GH-80545.
- Loading branch information
1 parent
95a13ca
commit 94a151a
Showing
4 changed files
with
248 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Bug #80545 (bcadd('a', 'a') and bcadd('1', 'a') doesn't throw an exception) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
try { | ||
bcadd('a', 'a'); | ||
} catch (\ValueError $e) { | ||
echo $e->getMessage() . PHP_EOL; | ||
} | ||
|
||
try { | ||
bcadd('1', 'a'); | ||
} catch (\ValueError $e) { | ||
echo $e->getMessage(); | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
bcadd(): Argument #1 ($num1) is not well-formed | ||
bcadd(): Argument #2 ($num2) is not well-formed |
Oops, something went wrong.