Re: [RFC] Warnings for PHP 8.5

From: Date: Tue, 29 Jul 2025 11:48:16 +0000
Subject: Re: [RFC] Warnings for PHP 8.5
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-128293@lists.php.net to get a copy of this message


On Tue, Jul 29, 2025, at 13:16, Alexandru Pătrănescu wrote:
> 
> On Tue, Jul 29, 2025 at 12:18 PM Rob Landers <rob@bottled.codes> wrote:
>> __
>> 
>> I am not sure that (int)"INF" or (int)"NAN" is misbehaving.
>> (int)"Password" also produces 0, and these are strings. If we had the time to
>> discuss it properly, I would argue that simply warning when casting a string to int is the most
>> sensible thing, just like we get an error when coercing a string to int, which is more consistent
>> across the language than just special casing some strings.
>> 
>> 
> 
> This is about INF and NAN, the float values, not the strings "INF" and
> "NAN".
> https://3v4l.org/fAFn3
> 
> -- Alex 

Thanks Alex, I missed that nuance!

— Rob


Thread (23 messages)

« previous php.internals (#128293) next »