note 123130 deleted from function.empty by cmb
| From: | cmb@php.net | Date: | Sun, 01 Dec 2019 09:20:48 +0000 |
| Subject: | note 123130 deleted from function.empty by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213354@lists.php.net to get a copy of this message | ||
Note Submitter: DimeCadmium
----
Each of the following statements is equivalent:
<?php
empty($x)
(!isset($x) || !$x)
!(isset($x) && $x)
?>
Note that this means PHP's odd and painful understanding of falsey is used, implying that you
can not use empty() to, say, determine if a form has been filled out fully. (Or you'll have fun
when someone wants to put "0" in a field.)