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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Tue Dec 10 11:01:23 2019 UTC