Forum Moderators: coopster

Message Too Old, No Replies

Quick OO PHP question

Naming a session array with the same name as a class

         

ryan_b83

7:32 pm on Aug 29, 2007 (gmt 0)

10+ Year Member



Hello I had a strange problem with a bit of code. Example:

$_SESSION['abc'] = "value";

I kept getting a fatal error for this and I could not figure out why. However one thing to note is that i do have a class with the same name as the array key "abc". So when i changed the session to read like this, it worked:

$_SESSION['abcd'] = "value";

In conclusion the only thing i could figure out is that i am not aloud to have a session's array key the same as a class name that is currently being used.

Am I totally wrong on this or is there something else im missing?

Thanks,
Ryan

RonPK

9:35 pm on Aug 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



2 quick questions:
* what is the error message?
* is register_globals set to on or off?

henry0

9:52 pm on Aug 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How "global" are the class var?

Post the class chunk regarding the same "name"