if ($obj1 == $obj2) { print "The same object.\n"; }