PHP » GoLang |
login |
register |
about
|
GoLang Ds\Hashable::hash
request it (375)
GoLang replacement for PHP's Ds\Hashable::hash
[edit | history]
Ds\Hashable::hash(PECL ds >= 1.0.0) Ds\Hashable::hash — Returns a scalar value to be used as a hash value DescriptionReturns 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. Caution
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. Caution
All objects that are equal must have the same hash value. ParametersThis function has no parameters. Return ValuesA scalar value to be used as this object's hash value. ExamplesExample #1 Ds\Hashable::hash() example
<?php |
more
Recently updated
more
Most requested
more
Last requests
|