Req #67855 [NEW]: No way to get current scale in use
| From: | daverandom@php.net | Date: | Mon, 18 Aug 2014 12:24:39 +0000 |
| Subject: | Req #67855 [NEW]: No way to get current scale in use | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187163@lists.php.net to get a copy of this message | ||
From: daverandom
Operating system: Any
PHP version: Irrelevant
Package: BC math related
Bug Type: Feature/Change Request
Bug description:No way to get current scale in use
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 bug report at https://bugs.php.net/bug.php?id=67855&edit=1
--