is_null

Finds whether a variable is null

Description

bool is_null(mixed $value)

Finds whether the given variable is null.

Parameters

value

The variable being evaluated.

Return Values

Returns true if value is null, false otherwise.

Examples

Example #1 is_null example

<?php

error_reporting(E_ALL);

$foo = NULL;
var_dump(is_null($inexistent), is_null($foo));

?>
Notice: Undefined variable: inexistent in ...
bool(true)
bool(true)

See Also

  • The null type
  • isset
  • is_bool
  • is_numeric
  • is_float
  • is_int
  • is_string
  • is_object
  • is_array