Split bcscale() signature

As of PHP 7.3.0, bcscale() may also be used as getter, which is not
properly reflected by making the $scale parameter optional.  Therefore,
we split the function signature.

Inspired by a patch provided by Tim van Dijen.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346739 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2019-02-07 13:14:36 +00:00
parent 767ded9aed
commit a0c42039db

View file

@ -3,20 +3,25 @@
<refentry xml:id="function.bcscale" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>bcscale</refname>
<refpurpose>Set default scale parameter for all bc math functions</refpurpose>
<refpurpose>Set or get default scale parameter for all bc math functions</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>bcscale</methodname>
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
<methodparam><type>int</type><parameter>scale</parameter></methodparam>
</methodsynopsis>
<para>
Sets the default scale parameter for all subsequent calls to bc math functions that
do not explicitly specify a scale parameter.
If <parameter>scale</parameter> is omitted, the function gets the current
scale factor.
</para>
<methodsynopsis>
<type>int</type><methodname>bcscale</methodname>
<void/>
</methodsynopsis>
<para>
Gets the current scale factor.
</para>
</refsect1>
@ -39,7 +44,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the old scale.
Returns the old scale when used as setter. Otherwise the current scale is returned.
</para>
</refsect1>