Ds\Hashable::hashReturns a scalar value to be used as a hash value 説明
abstract public mixed Ds\Hashable::hash()
Returns a scalar value to be used as the hash value of the objects.
While the hash value does not define equality, all objects that are equal according to Ds\Hashable::equals
must have the same hash value. Hash values of equal objects don't have to be unique, for example
you could just return 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. 警告
Do not pick a value that might change within the object, such as a public property. Hash table lookups would fail because the hash has changed. 警告
All objects that are equal must have the same hash value. パラメータこの関数にはパラメータはありません。 戻り値A scalar value to be used as this object's hash value. 例例1 Ds\Hashable::hash example
|