In my PHP class I have
public $a;
public $b;
public $c;
public $d;
and I set there values in the construct.
I am now attempting to write a update function, and i'm trying to check if they are updating, say $a, to be the same as it is.
function update($what, $to) {
if ($to == $this->what) return false;
...
}
$updated = $instance->update($a, "Foobar");
if ($updated) echo "Updated";
else echo "You didn't change the value";
but since I know this line
if ($to == $this->what) return false;
is invalid, i'm seeking a new way to write it.
Ideas?
Thanks in advance