I mean... I "set" it to NULL. So isset($somethingNULL) == true?
+10
A:
bool isset ( mixed $var [, mixed $var [, $... ]] )
Determine if a variable is set and is not NULL.
If a variable has been unset with unset(), it will no longer be set. isset() will return FALSE if testing a variable that has been set to NULL. Also note that a NULL byte ("\0") is not equivalent to the PHP NULL constant.
Return values
Returns TRUE if var exists and has value other than NULL, FALSE otherwise.
Gregory Pakosz
2009-12-31 15:51:35
+5
A:
Yes - from the ISSET() documentation:
$foo = NULL;
var_dump(isset($foo)); // FALSE
/* Array example */
$a = array ('test' => 1, 'hello' => NULL);
var_dump(isset($a['test'])); // TRUE
var_dump(isset($a['foo'])); // FALSE
var_dump(isset($a['hello'])); // FALSE
OMG Ponies
2009-12-31 15:51:41
Demonstrating how to test it yourself? Upvote for you, sir.
mozillalives
2009-12-31 15:57:27
Rather copy pasting the doc as I did :D But we're doing it to avoid just putting a link in case it gives a 404 afterwards (unlikely to happen with php.net though)
Gregory Pakosz
2009-12-31 16:00:19