Wow, is it a bug? Session variable is lost if array with the same

Wow, is it a bug? Session variable is lost if array with the same

am 27.11.2007 23:47:30 von alexandis

$_SESSION["a"] = "bitch"; $a = array(); print_r($_SESSION["a"]);
// it shows array()!!!
If make $a as variable - $_SESSION["a"] preserves its value...

p.s. PHP4

Re: Wow, is it a bug? Session variable is lost if array with thesame name is created!

am 27.11.2007 23:59:05 von Piotr Siudak

alexandis@gmail.com pisze:
> $_SESSION["a"] = "bitch"; $a = array(); print_r($_SESSION["a"]);
> // it shows array()!!!
> If make $a as variable - $_SESSION["a"] preserves its value...
>
> p.s. PHP4

no it is not a bug.
but it has not not been default behaviour since 22-Apr-2002

search for register_globals in your php.ini



--
Piotr Siudak