Req #67855 [Asn->Csd]: No way to get current scale in use

From: Date: Wed, 13 Sep 2017 14:06:56 +0000
Subject: Req #67855 [Asn->Csd]: No way to get current scale in use
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211130@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67855&edit=1 ID: 67855 Updated by: cmb@php.net Reported by: daverandom@php.net Summary: No way to get current scale in use -Status: Assigned +Status: Closed Type: Feature/Change Request Package: BC math related Operating System: Any PHP Version: Irrelevant -Assigned To: daverandom +Assigned To: cmb Block user comment: N Private report: N New Comment: PR #2739 has been merged, so this feature will be available as of PHP 7.3.0. Previous Comments: ------------------------------------------------------------------------ [2014-08-18 12:24:38] daverandom@php.net Description: ------------ It's possible to change the scale in use for bcmath functions using bcscale(), but it's not possible to retrieve the current value. ini_get() only returns the default value from php.ini (as it should). Suggested fix would be to make the argument to bcscale() optional, and have it return the old value. Test script: --------------- var_dump(ini_get('bcmath.scale')); var_dump(bcscale(4)); var_dump(ini_get('bcmath.scale')); var_dump(bcscale()); Expected result: ---------------- string(1) "0" int(0) string(1) "0" int(4) Actual result: -------------- string(1) "0" bool(true) string(1) "0" Warning: bcscale() expects exactly 1 parameter, 0 given in /in/UPp6D on line 6 NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67855&edit=1

« previous php.bugs (#211130) next »