Bug #80545 [NEW]: bcadd('a', 'a') doesn't throw an exception

From: Date: Tue, 22 Dec 2020 15:22:00 +0000
Subject: Bug #80545 [NEW]: bcadd('a', 'a') doesn't throw an exception
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231219@lists.php.net to get a copy of this message
From: terrafrost Operating system: any PHP version: 8.0.0 Package: BC math related Bug Type: Bug Bug description:bcadd('a', 'a') doesn't throw an exception Description: ------------ PHP 8.0.0 made it so that the bcmath functions (among others) "throw an Error exception if the validation of the parameters fails" but there's one condition in which a warning will still be triggered (as opposed to an exception being thrown). Test script: --------------- <?php bcadd('a', 'a'); Expected result: ---------------- throw new TypeError('bcadd(): Argument #1 ($num1) must be numeric'); or some such Actual result: -------------- trigger_error('bcadd: bcmath function argument is not well-formed', E_USER_WARNING); -- Edit bug report at https://bugs.php.net/bug.php?id=80545&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80545&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80545&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80545&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80545&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80545&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80545&r=support Expected behavior: https://bugs.php.net/fix.php?id=80545&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80545&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80545&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80545&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80545&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80545&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80545&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80545&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80545&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80545&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80545&r=mysqlcfg

« previous php.bugs (#231219) next »