is_null

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

is_null Prüft, ob eine Variable null enthält

Beschreibung

is_null(mixed $value): bool

Prüft, ob die gegebene Variable null enthält

Parameter-Liste

value

Die zu prüfende Variable.

Rückgabewerte

Liefert true wenn value null enthält, sonst false.

Beispiele

Beispiel #1 is_null()-Beispiel

<?php

error_reporting
(E_ALL);

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

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

Siehe auch

  • Der null-Typ
  • isset() - Prüft, ob eine Variable deklariert ist und sich von null unterscheidet
  • is_bool() - Prüft, ob eine Variable vom Typ boolean ist
  • is_numeric() - Prüft, ob eine Variable eine Zahl oder ein numerischer String ist
  • is_float() - Prüft, ob eine Variable vom Typ float ist
  • is_int() - Prüft, ob eine Variable vom Typ int ist
  • is_string() - Prüft, ob Variable vom Typ string ist
  • is_object() - Prüft, ob eine Variable vom Typ object ist
  • is_array() - Prüft, ob die Variable ein Array ist