Re: Re: [RFC] [Discussion] Add 4 new rounding modes to round() function
| From: | Tim Düsterhus | Date: | Fri, 06 Oct 2023 18:45:22 +0000 |
| Subject: | Re: Re: [RFC] [Discussion] Add 4 new rounding modes to round() function | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121255@lists.php.net to get a copy of this message | ||
Hi
On 10/5/23 23:37, Jorg Sowa wrote:
Why do you think a namespace would introduce a BC break? However I'd argue in favor of an enum, but within the global namespace. i.e. just \RoundingMode. https://github.com/search?q=%22class+RoundingMode%22+language%3Aphp&type=code only finds namespaced versions, so this should not be a break. If you prefer not to introduce an enum, then you should at least add PHP_ROUND_HALF_AWAY_FROM_ZERO as an alias for PHP_ROUND_HALF_UP (and likewise for HALF_DOWN) to make the constants internally consistent. Best regards Tim DüsterhusI will also echo Tim's idea of using an enum instead and a union type. For the namespace, I think it would make sense to use Maths\RoundingModeDoesn't Math/Maths namespace introduce BC break?