Re: Sessions and variable scope strangeness
| From: | Andrei Zmievski | Date: | Wed, 12 Jul 2000 20:40:14 +0000 |
| Subject: | Re: Sessions and variable scope strangeness | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6259@lists.php.net to get a copy of this message | ||
On Wed, 12 Jul 2000, Jacob Hanson / Electric Lucidity wrote:
> This works. I just don't understant why $nio needs to be
> declared global in order to register with the session correctly.
>
> Does anyone know?
Because the session is saved at the end of the script's execution, the
only symbol table available then is the global symbol table.
session_register() does not copy the variable's value to the session
data, it simply registers the variable's name in the list to be saved at
the end.
-Andrei
* Why is it always Segmentation's fault? *