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

From: Date: Sun, 27 Dec 2020 21:42:39 +0000
Subject: Bug #80545 [PATCH]: bcadd('a', 'a') doesn't throw an exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231269@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80545&edit=1 ID: 80545 Patch added by: j.de.nies@protonmail.com Reported by: terrafrost@php.net Summary: bcadd('a', 'a') doesn't throw an exception Status: Open Type: Bug Package: BC math related Operating System: any PHP Version: 8.0.0 Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: Bug #80545: Converted some type warnings to type errors in the "bcmath" extension. On GitHub: https://github.com/php/php-src/pull/6545 Patch: https://github.com/php/php-src/pull/6545.patch Previous Comments: ------------------------------------------------------------------------ [2020-12-22 15:22:00] terrafrost@php.net 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 this bug report at https://bugs.php.net/bug.php?id=80545&edit=1

« previous php.bugs (#231269) next »