Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Ds\HashableDs\Hashable::hash>
^Ds\HashableLast updated: Mon, 26 Oct 2026

Ds\Hashable::equals

(PECL ds >= 1.0.0)

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

Description

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.

Note:

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

Caution

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

Parameters

obj

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

Return Values

true if equal, false otherwise.


<Ds\HashableDs\Hashable::hash>
^Ds\HashableLast updated: Mon, 26 Oct 2026