php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67855 No way to get current scale in use
Submitted: 2014-08-18 12:24 UTC Modified: 2017-09-13 14:06 UTC
From: daverandom@php.net Assigned: cmb (profile)
Status: Closed Package: BC math related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daverandom@php.net
New email:
PHP Version: OS:

 

 [2014-08-18 12:24 UTC] 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

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-18 13:05 UTC] daverandom@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: daverandom
 [2017-09-13 14:06 UTC] cmb@php.net
-Status: Assigned +Status: Closed -Assigned To: daverandom +Assigned To: cmb
 [2017-09-13 14:06 UTC] cmb@php.net
PR #2739 has been merged, so this feature will be available as of
PHP 7.3.0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 16:01:30 2024 UTC