Doc #74842 [Asn->Csd]: The use of "is set" in the definition of isset is vague.

From: Date: Sun, 24 Mar 2019 20:08:34 +0000
Subject: Doc #74842 [Asn->Csd]: The use of "is set" in the definition of isset is vague.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16514@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74842&edit=1 ID: 74842 Updated by: girgias@php.net Reported by: dominic dot mayers at meditationstudies dot org Summary: The use of "is set" in the definition of isset is vague. -Status: Assigned +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Assigned To: girgias Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2019-03-24 20:06:23] girgias@php.net Automatic comment from SVN on behalf of girgias Revision: http://svn.php.net/viewvc/?view=revision&revision=347047 Log: Fix Doc Bug #74842 ------------------------------------------------------------------------ [2018-12-30 03:11:47] girgias@php.net The following patch has been added/updated: Patch Name: improved-isset-documentation Revision: 1546139507 URL: https://bugs.php.net/patch-display.php?bug=74842&patch=improved-isset-documentation&revision=1546139507 ------------------------------------------------------------------------ [2017-08-22 12:19:11] trainingsurat007 at gmail dot com http://www.training-surat.com/php-training-surat.php ------------------------------------------------------------------------ [2017-07-02 17:13:20] dominic dot mayers at meditationstudies dot org The fact that unset($v) undo the effect of $v = NULL, also reinforces this other view where $v is set after $v = NULL. Again, just pointing out that this other view is in the air, It almost feels as if phpers have adopted the concept that isset does not determine if a variable is set. ------------------------------------------------------------------------ [2017-07-02 16:46:46] dominic dot mayers at meditationstudies dot org The fact that is_null throws an exception when we use it with a variable that has never been assigned a value, but not when we have assigned NULL to it, suggests that we should have a different function, say isset_strict, to determine if a variable has been assigned a NULL or non NULL value to it. In fact, a few have proposed such a function in the comments. I am not suggesting it should be a built in function. I am just pointing out that an alternative view on "is set" is in the air. However, I feel it is important to bring out clearly, that the current definitions of isset, is_null and NULL are very harmonious and logical. In particular isset is the opposite of is_null, we unset a variable if we assign NULL to it, we set a variable if we assign a non NULL value to it and the purpose of isset is to determine if a variable is set. It's clean and simple. Note that we did not need the extra "... and is not NULL", which refers to a different view. However, it is perhaps better not to use "is set", because it might conflict with the way some people use it. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74842 -- Edit this bug report at https://bugs.php.net/bug.php?id=74842&edit=1

« previous php.doc.bugs (#16514) next »