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: 2020-10-21 16:00 UTC
From: cmb@php.net 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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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"
 [2020-10-21 16:00 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC