Re: [RFC] Add "is_representable_as_float()" and "is_representable_as_int()" functions

From: Date: Tue, 29 Jul 2025 18:14:23 +0000
Subject: Re: [RFC] Add "is_representable_as_float()" and "is_representable_as_int()" functions
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-128304@lists.php.net to get a copy of this message
> Alexandre Daubois <alex.daubois+php@gmail.com> hat am 29.07.2025 14:52 CEST geschrieben:
> 
>  
> Hi internals,
> 
> I would like to present the RFC to add the
> "is_representable_as_float()" and "is_representable_as_int()"
> functions. These functions provide developers with a way to check
> whether values can be losslessly converted between integer and
> floating-point representations.
> 
> https://wiki.php.net/rfc/is-representable-as-float-int
> 
> Best,
> Alexandre Daubois

Thanks for the RFC.

Since frameworks already have things like Strings::is_stringable() and Arr::arrayable(), I'd
suggest to use is_floatable(), is_intable() or is_integerable(), etc.
To me, this would also feel more consistent is is_float(), is_int(), etc.

Regards
Thomas


Thread (28 messages)

« previous php.internals (#128304) next »