|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75169 BCMath errors/warnings bypass PHP's error handling
Submitted: 2017-09-07 15:23 UTC Modified: 2017-09-13 14:22 UTC
From: Assigned: cmb (profile)
Status: Closed Package: BC math related
PHP Version: 7.0.23 OS: *
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:


 [2017-09-07 15:23 UTC]
BCMath reports some errors and warnings (such as "exponent too
large in raise") by directly writing to stderr[1], thereby
completely bypassing PHP's error handling.

[1] <>

Test script:

set_error_handler(function ($errno, $errstr) {
bcdiv('1', '0');
bcpow('1', '12345678901234567890');

Expected result:
string(6) "caught"
string(6) "caught"

Actual result:
string(6) "caught"
bc math error: exponent too large in raise


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-13 14:21 UTC]
Automatic comment on behalf of
Log: Fixed bug #75169 (BCMath errors/warnings bypass error handling)
 [2017-09-13 14:21 UTC]
-Status: Open +Status: Closed
 [2017-09-13 14:22 UTC]
-Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 04:01:24 2023 UTC