Re: RFC: blank() Function as a Complement to empty()
| From: | Bilge | Date: | Sat, 05 Apr 2025 19:23:43 +0000 |
| Subject: | Re: RFC: blank() Function as a Complement to empty() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127055@lists.php.net to get a copy of this message | ||
On 05/04/2025 20:18, Rob Landers wrote:
On Sat, Apr 5, 2025, at 21:10, Bilge wrote:You don't use empty() on objects.On 05/04/2025 19:41, Rob Landers wrote:$varl != falseempty() has very many uses.That is exactly the same as saying==has many uses. It does. So many uses that it's useless. Its semantics are nonsense.if (isset($var) && $varl != false) { foo($bool); }You should never be doing this. Cheers, BilgeHeh, to quote a great movie: That's just like, your opinion, man. In all seriousness, there are quite a number of uses for ==, especially because we don't have operators on objects, nor do we have value objects. Sometimes, equality isn't based on identity, but on value: https://3v4l.org/rRMNR — Rob