Re: why should $_SESSION be slower than other arrays?
| From: | Aaron Voisine | Date: | Thu, 09 Sep 2004 16:55:09 +0000 |
| Subject: | Re: why should $_SESSION be slower than other arrays? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196229@lists.php.net to get a copy of this message | ||
In any case, it would appear the comments in the session section of the
online docs are wrong or just out of date, and I don't need to worry
about it. I'll go ahead and add a comment to that effect on the
ref.session page.
l8r
Aaron
--- Marek Kilimajer <lists@kilimajer.net> wrote:
> Chris Dowell wrote:
> > Entirely off the top of my head, I would imagine it has to do with
> the
> > scope of the variables in question.
> >
> > When assigning a value to a variable, there must be some time spent
>
> > resolving the scope in which that variable is valid, to see if the
> new
> > value overwrites any existing value and to ensure that it is
> accessible
> > from the correct places. As a superglobal, however, $_SESSION has a
> very
> > specific and unchanging scope. If I were Zeev or Andi, I'd have
> added a
> > little optimisation into ZE to check for trivial cases such as this
> and
> > shortcut the tedious scoping.
> >
> > I could be wrong, but this seems to be the most obvious
> explanation. Has
> > anyone tried this with any other superglobals like $_POST or
> $_SERVER?
>
> Just tried it, $_SESSION is certainly faster then $_POST, $_GET and
> $_SERVER:
>
> Session var: 0.380021095276
> GET var: 0.50522685051
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail