Re: [DISCUSSION] bcmath: adding bcgetopts() and bcsetopts() to get or set bcmath options
| From: | Quake MMO | Date: | Wed, 16 Jul 2025 13:40:34 +0000 |
| Subject: | Re: [DISCUSSION] bcmath: adding bcgetopts() and bcsetopts() to get or set bcmath options | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128083@lists.php.net to get a copy of this message | ||
On 7/16/25 13:56, Ayesh Karunaratne wrote:
That would also totally work. Anything that would allow sanitizing the string directly in the extension as opposed to doing it in PHP would be a great progress. I would vouch for the sanitization switch to be a global state setting such as the bcscale, as opposed to (only) be a callable method/function. This way, we would avoid an extra call from PHP for sanitization.Would adding a bcgetopts(): int and a bcsetopts(int $opts): void calls be useful? At this time there's no way to influence bcmath's behavior other than bcscale().How about adding these as methods/properties to theBcMath\Numberclass?BcMath\Numberdoes not use thebcmath.scaleINI directive, and in my opinion, it is the correct way to do it. Everything that affects the operations are just there in the code, and there is no hidden global state.