Re: [DISCUSSION] Adding the "is_integer_safe()" function
| From: | Rowan Tommins [IMSoP] | Date: | Fri, 25 Jul 2025 21:09:27 +0000 |
| Subject: | Re: [DISCUSSION] Adding the "is_integer_safe()" function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128231@lists.php.net to get a copy of this message | ||
On 25 July 2025 14:40:47 BST, Alexandre Daubois <alex.daubois+php@gmail.com> wrote:
>
>I would like to gather feedback on the proposal to add an
>"is_integer_safe()" function to PHP.
From the name, I don't understand what this function would do. Do I pass in an integer, and get
a boolean telling me if it's safe? Safe for what? Do I pass in some other value and get a
boolean if it's safe to convert to an integer? What value exactly, and safe in what way?
That tells me two things:
1) You need to flesh out your proposal to be explicit about *what* it would do, as well as why.
2) The function needs a better name, to avoid confusion over what "safe" means.
Regards,
Rowan Tommins
[IMSoP]