You are here: Re: Don't unset that variable you need globally « PHP Language « IT news, forums, messages
Re: Don't unset that variable you need globally

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация