Posted by Michael Fesser on 01/07/08 11:25
..oO(Peter Pei)
>The fact is that $_SESSION[] = "a"; $_SESSION[]="b"; works - works on the
>initial page when it is set up.
It doesn't work. Configure your error_reporting directive how it should
be to E_ALL|E_STRICT and you'll get some notices:
Notice: Unknown: Skipping numeric key 0. in ...
Notice: Unknown: Skipping numeric key 1. in ...
>The problem is that the values are not retained on the next page. There is
>some other reasons behind, not what you have said.
Numeric keys are not allowed in the $_SESSION array. There's also a bug
report regarding this issue, even if it doesn't really clear things up.
http://bugs.php.net/bug.php?id=42472
So for an exact reason you would have to ask the PHP dev team. One
possible reason I could imagine comes from the old register_globals
days. With this directive enabled session variables were also
automatically populated as variables in the global namespace, but
variable names starting with a digit are not allowed.
Micha
Navigation:
[Reply to this message]
|