Re: New RFC : empty() function
| From: | Lynn | Date: | Mon, 30 Oct 2023 15:18:06 +0000 |
| Subject: | Re: New RFC : empty() function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121525@lists.php.net to get a copy of this message | ||
On Mon, Oct 30, 2023 at 1:24 PM Alessandro Rosa <alessandro.a.rosa@gmail.com>
wrote:
> Hi,
>
> I have posted a new RFC at this link
> https://wiki.php.net/rfc/empty_function
> where I suggested some improvements to the standard built-in empty()
> function and provided a number of examples.
>
> Thanks,
>
> Alessandro Rosa
> WEB : http://alessandrorosa.altervista.org
> LINKEDIN :
> https://www.linkedin.com/in/alessandro-rosa-9b7ba67b/
If anything I'd rather see
empty() disappear, but I'll settle with a
warning to be cautious when using it. We don't need a replacement as you
should create your own function to validate what you consider "empty" or
not based on the given context and variable type. For me `(bool) false or
"(int) 0" isn't empty either, it's still a value of sorts.