略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Ds\Hashable::equals

2024-12-21

Ds\Hashable::equals

(PECL ds >= 1.0.0)

Ds\Hashable::equalsDetermines whether an object is equal to the current instance

说明

abstract public 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.

注意:

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

警告

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

参数

obj

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

返回值

true if equal, false otherwise.

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/ds-hashable.equals.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3