Bug #78330 [Opn->Csd]: bcscale() modifications persist across requests

From: Date: Wed, 21 Oct 2020 16:00:03 +0000
Subject: Bug #78330 [Opn->Csd]: bcscale() modifications persist across requests
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229842@lists.php.net to get a copy of this message
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
+Status:             Closed
 Type:               Bug
 Package:            BC math related
 Operating System:   *
 PHP Version:        7.2Git-2019-07-24 (Git)
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Fixed with <http://git.php.net/?p=php-src.git;a=commitdiff;h=ac87880addfd22e651b210346178dc1ed851b1dd>.


Previous Comments:
------------------------------------------------------------------------
[2019-07-24 09:19:22] 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"

------------------------------------------------------------------------
[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)

« previous php.bugs (#229842) next »