Posted by lister on 04/12/07 14:53
I have the following code:
$Foo = new CFoo();
$Foo->Bar = 5;
$_SESSION['foo'] = $Foo;
$_SESSION['bar'] = $Foo->Bar;
$Foo->Bar = 10;
echo $Foo->Bar;
echo $_SESSION['foo']->Bar;
echo $_SESSION['bar'];
outputs
10
10
10
How can I force an array to contain an instance rather than a
reference, so for instance $_SESSION['bar'] is still equal to 5?
Thanks
Navigation:
[Reply to this message]
|