Re: Completely stumped (still) [message #185083 is a reply to message #185070] |
Tue, 25 February 2014 21:46 |
Christoph Michael Bec
Messages: 207 Registered: June 2013
Karma:
|
Senior Member |
|
|
Thomas 'PointedEars' Lahn wrote:
> Christoph Michael Becker wrote:
>
>> Jerry Stuckle wrote:
>>> On 2/24/2014 6:53 PM, Richard Yates wrote:
>>>> I inserted var_dump successively at each stage in the script to see
>>>> where it changes from the (correct) array to a (incorrect) string. I
>>>> narrowed it down to ONE statement, but cannot see how that could
>>>> possibly change the variable. Here's the section with var_dump, then
>>>> the one statement, and then the var_dump repeated exactly.
>>>>
>>>> var_dump($_SESSION['to']);
>>>> $to=$_SESSION['to'][$ct]['email'];
>>>> var_dump($_SESSION['to']);
>>>>
>>>> The output of the two var_dumps is:
>>>>
>>>> The first:
>>>> array(1) { [0]=> array(3)
>>>> { ["fname"]=> string(4) "Dick"
>>>> ["lname"]=> string(5) "Yates"
>>>> ["email"]=> string(23) "dyates(at)salemharvest(dot)org" }
>>>> }
>>>>
>>>> The second:
>>>> string(23) "dyates(at)salemharvest(dot)org"
>>>>
>>>> If I comment out the second line (that sets $to), the second var_dump
>>>> comes out correct. Am I losing my mind?
>>>
>>> The failing server has register_globals enabled.
>>
>> I'm still confused that it seems that register_globals makes the
>> respective global variables *references* to the session variables.
>
> Or both of them are references to the same array element. Whatever the
> implementation, it is the case that they yield the same value then, and it
> is – if I may say so – a *logical* consequence of how register_globals is
> supposed to work.
However, GPC parameters are *copied* to the respective global variables.
Why is it logical to make global variables references to session
variables (resp. let both reference the same variable/element)?
> $*_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>
--
Christoph M. Becker
|
|
|