Bug #78330 [Opn]: bcscale() modifications persist across requests
Edit report at https://bugs.php.net/bug.php?id=78330&edit=1
ID: 78330
Updated by: cmb@php.net
Reported by: cmb@php.net
Summary: bcscale() modifications persist across requests
Status: Open
Type: Bug
Package: BC math related
Operating System: *
-PHP Version: 7.4Git-2019-07-24 (Git)
+PHP Version: 7.2Git-2019-07-24 (Git)
Block user comment: N
Private report: N
New Comment:
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"
Previous Comments:
------------------------------------------------------------------------
[2019-07-24 08:40:33] 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)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78330&edit=1
Thread (3 messages)