Ds\Hashable::hashReturns a scalar value to be used as a hash value. Beschreibung
abstract public mixed Ds\Hashable::hash
( void
)
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. Achtung
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. Achtung
All objects that are equal must have the same hash value. Parameter-ListeDiese Funktion hat keine Parameter. RückgabewerteA scalar value to be used as this object's hash value. BeispieleBeispiel #1 Ds\Hashable::hash example
<?php |