public
Created

isset is the logical negation of is_null

  • Download Gist
gistfile1.aw
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
$ uname -v
Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
 
$ php --version
PHP 5.3.4 (cli) (built: Dec 15 2010 12:15:07)
 
$ php -a
Interactive mode enabled
 
<?
$null = NULL;
 
if ( is_null($null) ) {
echo "null is NULL\n";
}
if ( ! isset($null) ) {
echo "null is not set\n";
}
if ( is_null($not_set) ) {
echo "not_set is NULL\n";
}
if ( ! isset($also_not_set) ) {
echo "also_not_set is not set\n";
}
?>
 
null is NULL
null is not set
not_set is NULL
also_not_set is not set

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.