I was reading about php variables and in these two question :
it was mentioned that
When you are coping a variable into another, PHP will copy a reference to the first variable into the second variable. So your new variable, is actually a reference to the first one until now. The value is not copied yet. But if you try to change any of these variables, PHP will make a copy of the value, and then changes the variable.
Does this also apply for SESSION variables? I read on Stack Overflow somewhere that session variables were stored in disk. So until any changes are made to the SESSION variable, the SESSION variable will keep the reference? Is the reverse is also true? i.e.
$var = $_SESSION["var"]
or $_SESSION["var"] = $var
in both cases will store references?
EDIT:
Also, if I assign a class property in a constructor ($this->var = $var
), will it also hold reference?