Hi Tim,

On 05.10.23 21:57, Tim Düsterhus wrote:
Hi

On 10/4/23 08:35, Marc Bennewitz wrote:
As far as I understand you are in favor of option 1. (considering it a
bugfix) but how do you make sure this will not lead to different
application behavior overlooked on upgrading? Also there is no way to
opt-in new behavior.


Yes, I would be in favor of option 1 and I don't even see a reason not to do this in PHP 8.4 right away. As I mentioned before, this effectively can be considered a bug fix: PHP does not correctly round integers > 2^53.

While this is not a bug fix that is appropriate for the current stable branches, I don't see why it would not be appropriate for PHP 8.4 if there's an RFC for it.

In fact there is already a rounding bugfix (no RFC for that) in PHP 8.4:

https://github.com/php/php-src/blob/65a8c70f93ccb7e008de147cd4c357681c653bd0/UPGRADING#L75-L82

While PHP tries hard to keep backwards compatibility within a given major, keeping full compatibility is effectively impossible for the huge API surface PHP exposes. Every version includes *some* changes that are technically breaking for one reason or another.

Fixing edge cases like having 0.49999999999999994 rounded down correctly is a different story than having something simple like "round(10 / 2) === 5.0" to return false instead.


Best regards
Tim Düsterhus

Best,
Marc


Attachment: OpenPGP_0x3936ABF753BC88CE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to