1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/ext/bcmath/tests/bcscale_variation003.phpt
T
Nikita Popov ac87880add Update bcmath.scale when calling bcscale()
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.
2020-10-21 17:06:48 +02:00

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)