- compact: documentation ( source)
<?php
$x = NULL;
if (is_null($x)) { echo "x is null\n"; } else { echo "x is not null\n"; }
if (isset($x)) { echo "x is set\n"; } else { echo "x is not set\n"; }
if (is_null($y)) { echo "y is null\n"; } else { echo "y is not null\n"; }
if (isset($y)) { echo "y is set\n"; } else { echo "y is not set\n"; }
if (compact('y') != array()) { echo "y is set to null"; }