| Posted by Daniel Tryba on 07/06/05 04:18 
In comp.lang.php steve <UseLinkToEmail@dbforumz.com> wrote:> ok, so what is the difference between:
 >
 > unset($var)
 > and
 > $var = null;
 >
 > I know the first form removes the $var from name space, but is there
 > any functions to check the difference.  isset() responds the same way
 > to both.
 
 http://php.net/isset says it all:
 
 "isset() will return FALSE if testing a variable that has been set to
 NULL."
 
 I have no idea why (and who decided that) a variable set to null is
 considered unset (and a reference to a variable with value null not
 raising a "Undefined variable" notice). IMHO it simply should return
 true since it is just plain inconsistent.
  Navigation: [Reply to this message] |