PHPackages                             f500/equatable - 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. f500/equatable

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

f500/equatable
==============

Equatable objects and collections in PHP

v1.3.0(10y ago)08.9kMITPHP

Since Mar 25Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (6)Used By (0)

F500 \\ Equatable
=================

[](#f500--equatable)

[![Build Status](https://camo.githubusercontent.com/7d6d47b08e06dee5a75e8dbaf5710670e5d83bf58b5b11c7d5323546a577c643/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f663530302f657175617461626c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/f500/equatable/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/f3f952ebe3e64e38135dc5f3043865f26582f4450b8b3677a3a31b81d930f631/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f663530302f657175617461626c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/f500/equatable/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1695311d0ed70947365cbd37abc1e9ce1dcf8877300fc1c27f72d42a9c1ba051/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f663530302f657175617461626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/f500/equatable/?branch=master)

Equatable objects and collections in PHP.

We reach a limitation in PHP when we want to compare objects in such a way that `==` yields incorrect results. We often overcome this limitation by implementing a method like `equals($other)` encapsulating our specialized behaviour. This library provides an interface for this.

We hit secondary problems when we try to work with these objects, especially when dealing with arrays of them. Functions like `in_array()` and `array_search()` don't use our specialized `equals()` method, so they in turn yield incorrect results. To overcome these problems, this library provides a map (ordered dictionary-style collection) and a vector (stack-like collection). These are immutable and final, meant to replace normal arrays.

Authored by [Jasper N. Brouwer](https://github.com/jaspernbrouwer).

Under the collective flag of [Future500 B.V.](https://github.com/f500)

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

[](#installation)

```
composer.phar require f500/equatable
```

License
-------

[](#license)

[The MIT License (MIT)](https://github.com/f500/equatable/blob/master/LICENSE)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

5

Last Release

3700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b1ad490738a1f8743a80dd670a0343233dcac93d04a52103ec99a4f7a94dd85?d=identicon)[jaspernbrouwer](/maintainers/jaspernbrouwer)

---

Top Contributors

[![jaspernbrouwer](https://avatars.githubusercontent.com/u/738933?v=4)](https://github.com/jaspernbrouwer "jaspernbrouwer (73 commits)")

---

Tags

collectioncollectionsequalequalsequatable

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/f500-equatable/health.svg)

```
[![Health](https://phpackages.com/badges/f500-equatable/health.svg)](https://phpackages.com/packages/f500-equatable)
```

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[vistik/typed-collections

A simple way to create typed collections in PHP - build on Illuminate\\Support\\Collection

1128.2k5](/packages/vistik-typed-collections)[rotexsoft/versatile-collections

A collection package that can be extended to implement things such as a Dependency Injection Container, RecordSet objects for housing database records, a bag of http cookies, or technically any collection of items that can be looped over and whose items can each be accessed using array-access syntax or object property syntax.

186.0k1](/packages/rotexsoft-versatile-collections)

PHPackages © 2026

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