Re: [RFC] [Discussion] Rounding Integers as int

From: Date: Fri, 29 Sep 2023 15:28:28 +0000
Subject: Re: [RFC] [Discussion] Rounding Integers as int
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121173@lists.php.net to get a copy of this message
Hi On 9/26/23 12:39, Marc Bennewitz wrote:
I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding
I find the proposal reasonable, but I don't like the deprecation proposal, because it does not allow me to opt into the *new* behavior before PHP 9.0 arrives. Getting rid of the deprecation would also require me to either add a cast everywhere or add the error suppression operator everywhere and then revert that with PHP 9 depending on whether I want the new behavior or not. As far as I can tell all the other deprecations allow me to use the replacement functionality right away without needing to go through a two-step process. As the results of not casting to float first are arguably more correct, perhaps this could be considered a bugfix. While it would cause breakage for users that rely on strict types, obtaining the old behavior is just one (float) cast away. Best regards Tim Düsterhus

« previous php.internals (#121173) next »