php8.5
Home/ Manual/ var / functions/ is_null

is_null

PHP function Edit on GitHub ✎

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

Finds whether a variable is null

Description

is_null(mixed $value): bool

Finds whether the given variable is null.

Parameters

value

The variable being evaluated.

Return Values

Returns true if value is null, false otherwise.

Examples

is_null() example

php
<?php

error_reporting(E_ALL);

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

?>

See Also

Source: reference/var/functions/is-null.xml · from the official PHP manual (php/doc-en)