Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #13005
| Message-ID | <2257329.kQr4077IzS@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2014-02-26 22:20 +0100 |
| Subject | Re: Completely stumped (still) |
| Newsgroups | comp.lang.php |
| References | (5 earlier) <530d0f4c$0$9519$9b4e6d93@newsspool1.arcor-online.net> <2977130.zzfftj8Dkp@PointedEars.de> <530d2120$0$9504$9b4e6d93@newsspool1.arcor-online.net> <3567035.RYoFghLZKj@PointedEars.de> <530e3768$0$9515$9b4e6d93@newsspool1.arcor-online.net> |
Christoph Michael Becker wrote: > Thomas 'PointedEars' Lahn wrote: >> Christoph Michael Becker wrote: >>> Thomas 'PointedEars' Lahn wrote: >>>> Christoph Michael Becker wrote: >>>>> Thomas 'PointedEars' Lahn wrote: >>>>>> $*_VARS were first. >>>>> >>>>> According to the manual $HTTP_SESSION_VARS and $_SESSION are different >>>>> variables, anyway.[1] >>>>> >>>>> [1] <http://www.php.net/manual/en/reserved.variables.session.php> >>>> >>>> $_SESSION is a superglobal; $HTTP_SESSION_VARS is/was not (i.e., it >>>> needs to be declared a global if it is to be accessed from local >>>> context). But I am quite certain that when both were still supported, >>>> if you modified one, you modified the other (I have only PHP 5.5.9 to >>>> test with, where there is no $HTTP_SESSION_VARS anymore). >>> >>> The manual says: >>> >>> | $HTTP_SESSION_VARS contains the same initial information, but is not >>> | a superglobal. (Note that $HTTP_SESSION_VARS and $_SESSION are >>> | different variables and that PHP handles them as such) >> >> I *know* what the manual says. That does not prove anything. > > Testing on a single system might not prove much more, either. Anyway, I > tested the following script on PHP 5.2.13 (FCGI, register_globals=On or > Off, register_long_arrays=On): > > <?php > > session_start(); > var_dump($HTTP_SESSION_VARS["foo"]); > $_SESSION["foo"] = "bar"; > var_dump($HTTP_SESSION_VARS["foo"]); > > The result really surprised me: > > string(3) "bar" string(3) "bar" > > The output is the same, if I switch $HTTP_SESSION_VARS and $_SESSION. A > similar test regarding $_GET and $HTTP_GET_VARS showed the documented > behavior, by the way. > > It seems that is a documentation bug. ACK. > However, I suppose that's mostly rrelevant now, because the bug tracker is > concerned with PHP 5.4-5.6, and says wrt. earlier versions: "upgrade > first". But since PHP 5.4 register_long_arrays has been removed, so I > conclude that the $HTTP_*_VARS have been removed also, They have been removed indeed, as you can see in my PHP 5.5 test results. I found it curiouser, though, that you can use “global” outside a function. And not only that (which makes some sense as the file can be included), but that apparently you can actually *declare* a global variable in PHP this way (in my case, the previously non-existing $HTTP_SESSION_VARS). > in which case their documentation is even more in error, because it states > they are deprecated, but doesn't mention that they have been removed. > Now I am completely stumped. ACK. PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Completely stumped Richard Yates <richard@yatesguitar.com> - 2014-02-24 14:51 -0800
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-24 15:53 -0800
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-25 01:11 +0100
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-24 16:24 -0800
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-25 01:49 +0100
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-25 03:37 +0100
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-24 22:01 -0500
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-25 19:38 +0100
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-25 14:06 -0500
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-25 20:28 +0100
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-25 16:04 -0500
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-24 20:59 -0500
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-24 19:00 -0800
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-24 22:04 -0500
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-24 21:09 -0800
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-24 21:30 -0800
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-25 20:27 +0100
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-25 20:34 +0100
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-25 22:46 +0100
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-25 23:30 +0100
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-26 00:03 +0100
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-26 00:29 +0100
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-26 19:50 +0100
Re: Completely stumped (still) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-26 22:20 +0100
Re: Completely stumped (still) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-27 00:21 +0100
Re: Completely stumped (still) Richard Yates <richard@yatesguitar.com> - 2014-02-25 12:39 -0800
Re: Completely stumped (still) Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-25 16:06 -0500
csiph-web