Re: $HTTP_SESSION_VARS invisible in a function with register_globals=Off

From: Date: Sun, 07 Oct 2001 03:07:43 +0000
Subject: Re: $HTTP_SESSION_VARS invisible in a function with register_globals=Off
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70269@lists.php.net to get a copy of this message
Upgrade, I think... Check the ChangeLog. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: John K. Hohm <jhohm@acm.org> Newsgroups: php.general To: <php-general@lists.php.net> Sent: Saturday, October 06, 2001 10:05 AM Subject: $HTTP_SESSION_VARS invisible in a function with register_globals=Off > I am using PHP 4.0.5 on Debian GNU/Linux with register_globals=Off. > > I cannot gain access to $HTTP_SESSION_VARS from a function, no matter what > I try. This is not the case for other global associative arrays. For > example, this page: > > <? > function setup () > { > global $HTTP_SESSION_VARS, $X; > session_start(); > ++$HTTP_SESSION_VARS['a']; > ++$X['a']; > } > setup(); > > ?><html><body>$HTTP_SESSION_VARS['a']=<?=$HTTP_SESSION_VARS['a']?> > <br>$X['a']=<?=$X['a']?> > </body></html> > > gives this output every time: > > $HTTP_SESSION_VARS['a']= > $X['a']=1 > > If I move the ++$HTTP_SESSION_VARS['a']; line to just below the call of > setup(), it works as expected, incrementing that value each reload. > > Why is the real $HTTP_SESSION_VARS invisible from inside a function?!? >

« previous php.general (#70269) next »