Bug #80545 [Opn->Csd]: bcadd('a', 'a') doesn't throw an exception
| From: | nikic@php.net | Date: | Tue, 12 Jan 2021 08:51:20 +0000 |
| Subject: | Bug #80545 [Opn->Csd]: bcadd('a', 'a') doesn't throw an exception | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231504@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
Updated by: nikic@php.net
Reported by: terrafrost@php.net
Summary: bcadd('a', 'a') doesn't throw an exception
-Status: Open
+Status: Closed
Type: Bug
Package: BC math related
Operating System: any
PHP Version: 8.0.0
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of j.de.nies@protonmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=94a151a018d150ff6470fc35bc509f1bd8e3956a
Log: Fixed bug #80545
Previous Comments:
------------------------------------------------------------------------
[2021-01-09 11:40:29] arozkova676 at gmail dot com
Thanks for sharing the information.
https://www.igarageband.net/
------------------------------------------------------------------------
[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