PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

isset

Tags: PHP 5.x PHP 7.x PHP 8.x

isset — Determine if a variable is declared and is different than null.

Description

isset(
    mixed $var,
mixed ...$vars
): bool
Determine if a variable is considered set, this means if a variable is declared and is different than null.
If a variable has been unset with the unset() function, it is no longer considered to be set.
isset() will return false when checking a variable that has been assigned to null. Also note that a null character ("\0") is not equivalent to the PHP null constant.
If multiple parameters are supplied then isset() will return true only if all of the parameters are considered set. Evaluation goes from left to right and stops as soon as an unset variable is encountered.

Parameters

var
The variable to check
vars
Further variables.

Return Values

Returns true if var exists and has any value other than null. false otherwise.

isset - New snippets