EDIT: (UPDATED)
Maybe my question was not clear enough. Ok, lets put it this way:
$arr["a"] = 10;
var_dump($arr);
$arr["b"] =& $arr["a"];
var_dump($arr);
the first var_dump returns:
array
'a' => int 10
While the second one returns:
array
'a' => &int 10
'b' => &int 10
If I unset($arr["a"]) it will return:
array
'b' => int 10
The rule is, when 2 or more variables "points" to the same content var_dump will display the reference with an ampersand character (&).
In the case of $_SESSION, even with register_long_arrays = Off $_SESSION still shows a reference. So it is obvious that other variable is also pointing to the same content.
In other words, if I unset($_SESSION) there is still other variable somewhere that can be linked to. In the above example, when I unset($arr["a"]) I can still recover that content if I create a link, something like: $arr["z"] =& $arr["b"].
So, my original question was, does anyone know WHICH is that other variable? It is very probable that such variable do not exists... but I was wondering why inside PHP shows that reference.
Thank you
(Original question:)
When you create a session in PHP, for example:
session_start();
$_SESSION["name"] = "my name";
and dump the GLOBAL variables with:
var_dump($GLOBALS);
you will see something like:
'HTTP_SESSION_VARS' => &
array
'name' => string 'my name' (length=7)
'_SESSION' => &
array
'name' => string 'my name' (length=7)
'HTTP_SERVER_VARS' =>
array
...
As you can see, both variables $GLOBAL[HTTP_SESSION_VARS] and $_SESSION are references to other object's content... Do anyone knows which is that object?
In theory, if I unset both variables, somehow It must be possible to access that content... any clue?
Thank you!