I have a class that has multiple instance variables. Every time I set one variable, the rest are set to the same value.
ie The following code.
class TempObject
{
var $var1;
var $var2;
function setVar1($)
{
$this->$var1 = $;
}
function setVar2($)
{
$this->$var2 = $;
}
function TempObject($1, $2)
{
$this->setVar1($1);
$this->setVar2($2);
}
function getVar1()
{
return $this->$var1;
}
function getVar2()
{
return $this->$var2;
}
}
$temp = new TempObject("Testing", "1234");
echo "Var1=".$this->getVar1()."\n";
echo "Var2=".$this->getVar2();
Will print out the following:
1234
1234
Any ideas?