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

Reply via email to