$save = $a; //WE NEED A COPY HERE!!! $a = $data; //Set a to the value of $data (copy) $same = ($a === $b); //Check if $var2 was modified too ... $a = $save; //Undo our changes ...
}
return $same;
} ?>
Steve Clay (06-Apr-2007 09:24)
BenBE's function is broken for testing objects. Here's a variation on it just for testing objects:
<?php function same_obj(&$var1, &$var2) {
if ($var1 !== $var2) {
return false;