php.net |  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: 2019-07-24 09:19 UTC
From: cmb@php.net Assigned:
Status: Open 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

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


Test script:
---------------
<?php
var_dump(bcscale(42));
?>


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


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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

<?php
var_dump(bcadd('1', '1'));
bcscale(3);
?>

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"
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 15 03:01:24 2019 UTC