On Apr 12, 6:53 pm, "Alvaro G. Vicario"
<webmas...@NOSPAMdemogracia.comwrote:
Quote:
*** lister escribió/wrote (12 Apr 2007 07:53:54 -0700):
>
>
>
>
>
Quote:
$Foo = new CFoo();
$Foo->Bar = 5;
>
Quote:
$_SESSION['foo'] = $Foo;
$_SESSION['bar'] = $Foo->Bar;
>
>
Quote:
echo $Foo->Bar;
echo $_SESSION['foo']->Bar;
echo $_SESSION['bar'];
>
>
In my system, this code prints:
>
10
10
5
>
A wild guess... register_globals set to on?
>
--
-+
http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web:
http://bits.demogracia.com
+- Mi web de humor con rayos UVA:
http://www.demogracia.com
--- Hide quoted text -
>
- Show quoted text -
Many thanks for your reply, but I think I've just realised what is
going on.
Bar is actually another object in my real code, and I've just read
that all objects are references. D'oh.
I have also found the "clone" command. <slinks away>