On Thu, 4 Mar 2021 at 17:49, G. P. B. <george.bany...@gmail.com> wrote:
> On Thu, 4 Mar 2021 at 13:23, Andreas Leathley <a.leath...@gmx.net> wrote: > >> On 04.03.21 14:07, G. P. B. wrote: >> > This new version of the RFC can be found on the wiki: [2] >> > https://wiki.php.net/rfc/implicit-float-int-deprecate >> >> I like the RFC, but I think the diagnostic messages will be hard to >> understand when they come up in real scripts, especially because they >> can be platform-dependent and can have two different reasons, and >> "non-compatible" is not self-explanatory. Giving a very specific message >> would be more helpful for people experiencing these errors, something >> like: >> >> * Implicit conversion to int from float(-string) with fractional part >> * Implicit conversion to int from float(-string) which is outside of >> int range (=> maybe also mentioning the range of the platform) >> >> (Maybe there are additional possible errors to consider, but those two >> seem two obvious possibilities) >> > > The other cases would be converting from infinity (+ or -) or a NaN value. > > But having specific messages is a reasonable enhancement but does make > the implementation more complicated as one needs to determine what is > causing > the incompatibility. > > I'll have a think about this. > > Best, > > George P. Banyard > Amended the RFC and implementation so the incompatible-integer float value is shown in the deprecation warning. Latest version can as usual be found here: https://wiki.php.net/rfc/implicit-float-int-deprecate I would like to move this to voting at the end of the week as it's been about a month since the initial discussion about the RFC [1] started. Best regards, George P. Banyard [1] https://externals.io/message/113077