PHPackages                             hedronium/key-array - 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. hedronium/key-array

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

hedronium/key-array
===================

Library that allows you tu use arrays as keys for arrays!

v0.9.0(9y ago)014MITPHP

Since Dec 23Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Hedronium/KeyArray)[ Packagist](https://packagist.org/packages/hedronium/key-array)[ RSS](/packages/hedronium-key-array/feed)WikiDiscussions master Synced 2mo ago

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

KeyArray
========

[](#keyarray)

Allowing you to use arrays as keys for associative arrays. *Only supports flat arrays of scalar values.*

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

[](#installation)

```
composer require hedronium/key-array
```

Usage
-----

[](#usage)

Just Instantiate the class, or call the `KeyArray::array()` method to instantiate it.

```
use Hedronium\KeyArray\KeyArray;

$arr = new KeyArray;

// or
$arr = KeyArray::array();
```

then proceed to use it like a normal array.

```
$arr[[]]              = 'The void in my heart.';
$arr[['a']]           = 'AYY';
$arr[['b']]           = 'BEE';
$arr[['a', 'b']]      = 'AYY-BEE';
$arr[['a', 'b', 'c']] = 'AYY-BEE-CEE';
```

iteration with `foreach` works too.

```
foreach ($arr as $key => $val) {
	echo str_pad(implode(' -> ', $key), 20, ' ', STR_PAD_LEFT);
	echo ' = ';
	echo $val;
	echo PHP_EOL;
}

////// OUTPUT: /////////////////////////
//             = The void in my heart.
//           a = AYY
//      a -> b = AYY-BEE
// a -> b -> c = AYY-BEE-CEE
//           b = BEE
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4bb2891c32fb2ae023efa0a533c4c912c688c763c16e3bd03528e9c7f83ece2?d=identicon)[hedronium](/maintainers/hedronium)

---

Top Contributors

[![omranjamal](https://avatars.githubusercontent.com/u/4700757?v=4)](https://github.com/omranjamal "omranjamal (3 commits)")

### Embed Badge

![Health badge](/badges/hedronium-key-array/health.svg)

```
[![Health](https://phpackages.com/badges/hedronium-key-array/health.svg)](https://phpackages.com/packages/hedronium-key-array)
```

PHPackages © 2026

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