|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/erp.theinteractive.co.in/vendor/php-ds/php-ds/src/ |
Upload File : |
<?php
namespace Ds;
/**
* Hashable is an interface which allows objects to be used as keys.
*
* It’s an alternative to spl_object_hash(), which determines an object’s hash
* based on its handle: this means that two objects that are considered equal
* by an implicit definition would not treated as equal because they are not
* the same instance.
*
* @package Ds
*/
interface Hashable
{
/**
* Produces a scalar value to be used as the object's hash, which determines
* where it goes in the hash table. While this value does not have to be
* unique, objects which are equal must have the same hash value.
*
* @return mixed
*/
public function hash();
/**
* Determines if two objects should be considered equal. Both objects will
* be instances of the same class but may not be the same instance.
*
* @param mixed $obj An instance of the same class to compare to.
*/
public function equals($obj): bool;
}