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]
|