This page should include a note on variable lifecycle:
Before a variable is used, it has no existence. It is unset. It is possible to check if a variable doesn't exist by using isset(). This returns true provided the variable exists and isn't set to null. With the exception of null, the value a variable holds plays no part in determining whether a variable is set.
Setting an existing variable to null is a way of unsetting a variable. Another way is variables may be destroyed by using the unset() construct.
<?php
print isset($a); $b = 0; $c = array(); $b = null; unset($c); ?>
is_null() is an equivalent test to checking that isset() is false.
The first time that a variable is used in a scope, it's automatically created. After this isset is true. At the point at which it is created it also receives a type according to the context.
<?php
$a_bool = true; $a_str = 'foo'; ?>
If it is used without having been given a value then it is uninitalized and it receives the default value for the type. The default values are the _empty_ values. E.g Booleans default to FALSE, integers and floats default to zero, strings to the empty string '', arrays to the empty array.
A variable can be tested for emptiness using empty();
<?php
$a = 0; ?>
Unset variables are also empty.
<?php
empty($vessel); ?>
Everything above applies to array elements too.
<?php
$item = array();
$item['unicorn'] = '';
$item['unicorn'] = 'Pink unicorn';
?>
For arrays, this is important because accessing a non-existent array item can trigger errors; you may want to test arrays and array items for existence with isset before using them.