is_null

Finds whether a variable is null

Syntax

is_null(mixed $value): bool

Parameters

value

The variable being evaluated.

Return

Returns true if value is null, false otherwise.

Examples

1

<?

$value = null;

$return = is_null($value);

var_export($return);

?>
true

2

<?

// $value does not exist

$return = is_null($value);

var_export($return);

?>
true
HomeMenu