PHPackages                             grifart/equalable-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. grifart/equalable-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

grifart/equalable-utils
=======================

Provides a universal equals() function.

v1.0.4(1y ago)017.3k↓30.4%[1 issues](https://github.com/grifart/equalable-utils/issues)1MITPHPPHP ^8.2

Since Nov 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/grifart/equalable-utils)[ Packagist](https://packagist.org/packages/grifart/equalable-utils)[ RSS](/packages/grifart-equalable-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (1)

Equalable utils
===============

[](#equalable-utils)

Are objects equal or not? PHP defines only instance equality using `===` operator. Then there is comparision by value `==` which compares by object values, but user-land code cannot modify how they are compared.

This is why universal [`equals()` method exists in Java](https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)). PHP is missing anything like that.

This is why I have implemented global `equals()` function provides logic equality of objects. Which objects are equal and which not can be modified by several things - see bellow.

Installation
------------

[](#installation)

```
composer require grifart/equalable-utils
```

Implementing logical equality
-----------------------------

[](#implementing-logical-equality)

There are several ways of implementhing logic equality.

### `\Ds\Hashable` (from PHP DS extension)

[](#dshashable-from-php-ds-extension)

[Hashable](http://php.net/manual/en/class.ds-hashable.php) is PHP clone of Java `equals()` and `hashCode()` method. If you like to use implementing objects in collection this would make the most sense.

### `\Comparable` interface proposal

[](#comparable-interface-proposal)

This library supports [`\Comparable`](https://github.com/grifart/comparable-polyfill) interface and tries to compare objects.

### Just implement equals($other), is($other) or isEqualTo($other) methods

[](#just-implement-equalsother-isother-or-isequaltoother-methods)

This methods must behave the same as [Java `equals()` method](https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)).

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance42

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~659 days

Total

5

Last Release

460d ago

PHP version history (2 changes)v1.0.0PHP &gt;= 7.1.0

v1.0.4PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/939d12e9a77e30f843e33a785f81d8ee45b71bf2db88c0d32c0d36571c71a58d?d=identicon)[jkuchar](/maintainers/jkuchar)

---

Top Contributors

[![jkuchar](https://avatars.githubusercontent.com/u/133822?v=4)](https://github.com/jkuchar "jkuchar (8 commits)")[![jiripudil](https://avatars.githubusercontent.com/u/1042159?v=4)](https://github.com/jiripudil "jiripudil (6 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/grifart-equalable-utils/health.svg)

```
[![Health](https://phpackages.com/badges/grifart-equalable-utils/health.svg)](https://phpackages.com/packages/grifart-equalable-utils)
```

###  Alternatives

[suncat/mobile-detect-bundle

Symfony2/3/4 bundle for detect mobile devices, managing mobile view types, redirect to mobile version.

4035.3M7](/packages/suncat-mobile-detect-bundle)[snowdog/frontools

Set of front-end tools for Magento 2, based on Gulp.js

4241.3M1](/packages/snowdog-frontools)[spatie/laravel-dashboard

A dashboard for Laravel

568156.1k94](/packages/spatie-laravel-dashboard)[brick/schema

Schema.org library for PHP

5163.7k1](/packages/brick-schema)[ibericode/vat-bundle

Bundle for using ibericode/vat in a Symfony environment

21254.5k](/packages/ibericode-vat-bundle)[sylius/taxonomy

Taxonomies - categorization of domain models in PHP projects.

14435.6k10](/packages/sylius-taxonomy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
