Will isset() return false if I assign NULL to a variable?

openfrog picture openfrog · Dec 31, 2009 · Viewed 17.7k times · Source

I mean... I "set" it to NULL. So isset($somethingNULL) == true?

Answer

Gregory Pakosz picture Gregory Pakosz · Dec 31, 2009
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.

From the manual. Examples on the same page.