« Ds\Hashable
Ds\Hashable::hash »

Ds\Hashable::equals

(PECL ds >= 1.0.0)

Ds\Hashable::equals — Determines whether an object is equal to the current instance

説明

abstract public function Ds\Hashable::equals(object $obj): bool

Determines whether another object is equal to the current instance.

This method allows objects to be used as keys in structures such as Ds\Map and Ds\Set, or any other lookup structure that honors this interface.

注意:

It's guaranteed that obj is an instance of the same class.

警告

It's important that objects which are equal also have the same hash value. See Ds\Hashable::hash().

パラメータ

obj

The object to compare the current instance to, which is always an instance of the same class.

戻り値

true if equal, false otherwise.

関連キーワード:
instance   Hashable   equal   current   Determines   whether   hash   equals   objects   abstract   method   allows   used   keys   structures   lookup   structure   honors   interface   guaranteed   important   also   compare   always   otherwise
関連する関数・ページ:
class.ds-hashable   ds-hashable.hash   ds-set.contains   ds-map.union   ds-set.add   ds-map.xor