You are here: Re: Don't_unset_that_variable_you_n « PHP Language « IT news, forums, messages
Re: Don't_unset_that_variable_you_n

Posted by Hilarion on 11/21/25 11:20

> > steve wrote:
> > > Say you have defined a variable $var in your main script.
> > >
> > > Now in a function you access it using:
> > > global $var;
> > >
> > > But you want to set it to null inside the function.
> > > DO: $var = null;
> > > DONT DO: unset($var);
> > >
> > > Why? Because the 2nd way removes the variable from the name
> > > space,
> > > and it is no longer globally available. Cost me 10 hours....

> [...] if you find that inf on php site, please post.

Read Kimmo Laine post. It contains the link and manual fragment
which describes the case ("the local variable is destroyed").

Hilarion

 

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

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