mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
ac87880add
We should keep the value of bcmath.scale and the internal bc_precision global synchronized. Probably more important than the ability to retrieve bcmath.scale via ini_get(), this also makes sure that the set scale does not leak into the next request, as it currently does.
27 lines
456 B
PHP
27 lines
456 B
PHP
--TEST--
|
|
bcscale() return value
|
|
--SKIPIF--
|
|
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
|
--INI--
|
|
bcmath.scale=0
|
|
--FILE--
|
|
<?php
|
|
var_dump((int) ini_get('bcmath.scale'));
|
|
var_dump(bcscale(1));
|
|
var_dump((int) ini_get('bcmath.scale'));
|
|
var_dump(bcscale(4));
|
|
var_dump((int) ini_get('bcmath.scale'));
|
|
var_dump(bcscale());
|
|
var_dump((int) ini_get('bcmath.scale'));
|
|
var_dump(bcscale());
|
|
?>
|
|
--EXPECT--
|
|
int(0)
|
|
int(0)
|
|
int(1)
|
|
int(1)
|
|
int(4)
|
|
int(4)
|
|
int(4)
|
|
int(4)
|