Hi Tim, On 29.09.23 17:28, Tim Düsterhus wrote:
The deprecation would act as an information for upcoming behavior change, not classical deprecation of future removal. If the new behavior is what you want, than you don't need to change anything as a deprecation message should not break anything. At the same time people relying on the old behavior of implicit cast gets informed that they have to cast explicit now.HiOn 9/26/23 12:39, Marc Bennewitz wrote:I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-roundingI 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.
I first was playing around with adding a new argument. First by default keep existing behavior, in next changing default to new behavior and later again get rid of the argument. But this would force users to migrate multiple times and it would take years to finish.
Changing the behavior without further notice (deprecation) this could be a huge BC ending up in a lot of uncaught bugs especially on such high frequently used functions.
Best regards Tim Düsterhus
Best, Marc
OpenPGP_0x3936ABF753BC88CE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature