|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80545 bcadd('a', 'a') doesn't throw an exception
Submitted: 2020-12-22 15:22 UTC Modified: -
From: Assigned:
Status: Closed Package: BC math related
PHP Version: 8.0.0 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2020-12-22 15:22 UTC]
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:
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);


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-27 21:42 UTC] j dot de dot nies at protonmail dot com
The following pull request has been associated:

Patch Name: Bug #80545: Converted some type warnings to type errors in the "bcmath" extension.
On GitHub:
 [2021-01-09 11:40 UTC] arozkova676 at gmail dot com
Thanks for sharing the information.
 [2021-01-12 08:51 UTC]
-Status: Open +Status: Closed
 [2021-01-12 08:51 UTC]
Automatic comment on behalf of
Log: Fixed bug #80545
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 05:01:29 2024 UTC