is_null

(PHP 4 >= 4.0.4, PHP 5, PHP 7)
Finds whether a variable is NULL
bool is_null ( mixed $var )

Finds whether the given variable is NULL.

Parameters:
var

The variable being evaluated.

Returns:

Returns TRUE if var is null, FALSE otherwise.

Examples:
is_null() example
1
2
3
4
5
6
7
8
<?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:

NULL -

isset() -

is_bool() -

is_numeric() -

is_float() -

is_int() -

is_string() -

is_object() -

is_array() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.