I'm having a problem using classes. The problem stemed from using arrays to store a bunch of users and their usage times.
I have an object with two members, $name and $onlineSecs. No matter how hard I try...$name always gets modified. I try referencing $onlineSecs directly...I've tried writing mod functions. I cannot stop the problem. Here is a simplified code chunk (the echo's are for debugging): <?php class someuser{ var $name; var $onlineSecs; function someuser(){ echo "Default constructor<BR>\n"; $this->$name = 'Some Name'; echo "name: ".$this->$name."<BR>\n"; $this->$onlineSecs = 0; echo "name: ".$this->$name."<BR>\n"; echo "ontime: ".$this->$onlineSecs."<BR>\n"; } } $bob = new someuser; echo "Bob's Name: ".$bob->$name."<BR>\n"; echo "Bob's ontime: ".$bob->$onlineSecs."<BR>\n"; ?> It produces the following output: Default constructor<BR> name: Some Name<BR> name: 0<BR> ontime: 0<BR> Bob's Name: 0<BR> Bob's ontime: 0<BR> However...all the Names should be "Some name". Can someone please explain to me what dumb mistake I've made becuase I'm tearing my hair out over something so simple! Thank you, Dickon...