|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78330 bcscale() modifications persist across requests
Submitted: 2019-07-24 08:40 UTC Modified: 2020-10-21 16:00 UTC
From: Assigned: cmb (profile)
Status: Closed Package: BC math related
PHP Version: 7.2Git-2019-07-24 (Git) 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:


 [2019-07-24 08:40 UTC]
When bcscale() is used as setter, the modifications persist across
requests.  This is contrary to changing bcmath.scale via

Test script:

Expected result:
1st request: int(0)
2nd request: int(0)

Actual result:
1st request: int(0)
2nd request: int(42)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-24 09:19 UTC]
-PHP Version: 7.4Git-2019-07-24 (Git) +PHP Version: 7.2Git-2019-07-24 (Git)
 [2019-07-24 09:19 UTC]
Test script for PHP < 7.3.0:

var_dump(bcadd('1', '1'));

Expected result:

1st request: string(1) "2"
2nd request: string(1) "2"

Actual result:

1st request: string(1) "2"
2nd request: string(5) "2.000"
 [2020-10-21 16:00 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 00:01:28 2024 UTC