note 121296 deleted from function.isset by cmb
| From: | cmb@php.net | Date: | Sun, 05 Jan 2020 08:10:48 +0000 |
| Subject: | note 121296 deleted from function.isset by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213738@lists.php.net to get a copy of this message | ||
Note Submitter: dominic dot mayers at meditationstudies dot org
----
The comment http://php.net/manual/en/function.is-null.php#80409
brings the interesting point that is_null will throw an error if the variable was not set at all.
So, we can distinguish a variable that is unset through a NULL assignment and a variable that is
simply not set at all. However, the returned value under is_null is the same in both cases, only
the error message differs.
We can define another function that determines if the variable is "set," including
"set" by a NULL assignment. It's a different concept, different definitions of
isset, etc. Mixing these different concepts can be confusing.
In the current definitions for isset, is_null, NULL, etc., the extra "and is not NULL" in
the definition of isset is redundant, because is_null is the opposite of isset. We should not mix
that with the other concept mentioned above.