PHPackages                             pinepain/php-object-maps - 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. pinepain/php-object-maps

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

pinepain/php-object-maps
========================

ObjectMap structures for PHP

v0.4.0(8y ago)519921MITPHPPHP ~7.2

Since Jan 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pinepain/php-object-maps)[ Packagist](https://packagist.org/packages/pinepain/php-object-maps)[ RSS](/packages/pinepain-php-object-maps/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (6)Used By (1)

WARNING: This project is UNSUPPORTED and ABANDONED
==================================================

[](#warning-this-project-is-unsupported-and-abandoned)

I'm moving away from PHP world and all my PHP projects going to be abandoned too. Abandoning this project too as I have no intent to continue working on it unless there would be strong request from community and commercial interest. No more updates or documentation will be made. If someone is interested, feels free to contact me using email specified in my GitHub profile.

Weak-referenced data structures for PHP based on Ref php extension
==================================================================

[](#weak-referenced-data-structures-for-php-based-on-ref-php-extension)

[![Build Status](https://camo.githubusercontent.com/9039f3b6e1a025ee65db655a76146f6d62ea5a24c2efb18d9201720065ebe797/68747470733a2f2f7472617669732d63692e6f72672f70696e657061696e2f7068702d6f626a6563742d6d6170732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pinepain/php-object-maps)[![Code Coverage](https://camo.githubusercontent.com/409c97999ceaa69cecf9a167b2f4b477ffd5f839383a7fe80de63329c6ece45c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70696e657061696e2f7068702d6f626a6563742d6d6170732f6261646765732f636f7665726167652e706e673f623d7265666163746f72)](https://scrutinizer-ci.com/g/pinepain/php-object-maps/?branch=refactor)

### PLEASE READ:

[](#please-read)

Maintaining this project takes significant amount of time and efforts. If you like my work and want to show your appreciation, please consider supporting me at .

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- (optional, required only for maps weak behavior) [php-ref](https://github.com/pinepain/php-ref) extension

Installation:
-------------

[](#installation)

```
composer require pinepain/php-object-maps

```

Docs:
-----

[](#docs)

This library offers two main classes: `ObjectMap` and `ObjectBiMap`. They are what their name is - classic object maps which map object keys to object values.

The key difference between `ObjectMap` and `ObjectBiMap` is that `ObjectBiMap` require all values to be unique and it offers you to get mirrored `ObjectBiMap` map with keys and values from source map flipped. Note, that flipped map will still maintain connection to the original one and thus any modification to any `ObjectBiMap` in a chain will be reflected on all chain.

### Maps behavior

[](#maps-behavior)

Both `ObjectMap` and `ObjectBiMap` offers weak variations ([php-ref](https://github.com/pinepain/php-ref) extension required) which could be specified by passing one of `ObjectMapInterface::{WEAK_KEY,WEAK_VALUE,WEAK_KEY_VALUE}` constants to the constructor. By default no weakness enabled. Note, that when weak behavior enable on key or/and value, their refcount won't be incremented by map internals and thus it is possible that they will be destructed without a need be purged from map.

`WEAK_KEY` means that key-value pair will be removed as long as key will be destructed. `WEAK_VALUE` is the same for value and `WEAK_KEY_VALUE` will trigger removal when key or value will be destructed.

For more details see [tests](./tests).

License
-------

[](#license)

[php-object-maps](https://github.com/pinepain/php-object-maps) PHP library is licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~197 days

Total

5

Last Release

3036d ago

PHP version history (2 changes)v0.1.0PHP ~7.0

v0.4.0PHP ~7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2185793?v=4)[Bohdan Padalko](/maintainers/pinepain)[@pinepain](https://github.com/pinepain)

---

Top Contributors

[![pinepain](https://avatars.githubusercontent.com/u/2185793?v=4)](https://github.com/pinepain "pinepain (26 commits)")

---

Tags

mapbimapobject mapobject bimapweak object mapweak object bimap

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pinepain-php-object-maps/health.svg)

```
[![Health](https://phpackages.com/badges/pinepain-php-object-maps/health.svg)](https://phpackages.com/packages/pinepain-php-object-maps)
```

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

96864.5M34](/packages/phpcollection-phpcollection)[dasprid/enum

PHP 7.1 enum implementation

382158.8M12](/packages/dasprid-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49753.5M104](/packages/marc-mabe-php-enum)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.3k443.7k14](/packages/aimeos-map)[spatie/geocoder

Geocoding addresses to coordinates

8425.0M19](/packages/spatie-geocoder)[dusank/knapsack

Collection library for PHP

5351.0M25](/packages/dusank-knapsack)

PHPackages © 2026

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