Bug #80545 [Com]: bcadd('a', 'a') doesn't throw an exception
| From: | arozkova676 at gmail dot com | Date: | Sat, 09 Jan 2021 11:40:29 +0000 |
| Subject: | Bug #80545 [Com]: bcadd('a', 'a') doesn't throw an exception | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231461@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
Comment by: arozkova676 at gmail dot 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:
Thanks for sharing the information.
https://www.igarageband.net/
Previous Comments:
------------------------------------------------------------------------
[2020-12-27 21:42:39] 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: https://github.com/php/php-src/pull/6545
Patch: https://github.com/php/php-src/pull/6545.patch
------------------------------------------------------------------------
[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