PHPackages                             mattyg/array\_column\_maintain\_keys - 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. mattyg/array\_column\_maintain\_keys

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

mattyg/array\_column\_maintain\_keys
====================================

A wrapper for array\_column that maintains the keys of the original array.

1.0.1(10y ago)0211UnlicensePHP

Since Jan 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/djmattyg007/array_column_maintain_keys)[ Packagist](https://packagist.org/packages/mattyg/array_column_maintain_keys)[ Docs](https://github.com/djmattyg007/array_column_maintain_keys)[ RSS](/packages/mattyg-array-column-maintain-keys/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (1)

```
array_column_maintain_keys() is a wrapper for the array_column() function
introduced in PHP 5.5 (or usable in 5.3 and 5.4 via the recommended userland
polyfill, see link below).

The default behaviour of array_column() is to trash the keys from the top-level
input array, and instead return a numerically-indexed array. You can optionally
pass it the name of a second key in the sub-arrays of the input array, and have
it use the values of those keys for the keys of the return array instead.
Unfortunately, there is no option to have it use the keys of the top-level
input array.

This wrapper function, which also uses array_combine() and array_keys(),
resolves that problem quite nicely.

See here for the recommended userlannd polyfill of array_column():
https://github.com/ramsey/array_column

This software is released into the public domain without any warranty.
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3819d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29e8622a72b856256e1b0f9e5ba9480444c6391e6e80a48eeb52fc4118eacf06?d=identicon)[djmattyg007](/maintainers/djmattyg007)

---

Top Contributors

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

---

Tags

arrayarray\_column

### Embed Badge

![Health badge](/badges/mattyg-array-column-maintain-keys/health.svg)

```
[![Health](https://phpackages.com/badges/mattyg-array-column-maintain-keys/health.svg)](https://phpackages.com/packages/mattyg-array-column-maintain-keys)
```

###  Alternatives

[doctrine/collections

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

6.0k423.8M1.4k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k309.5M3.0k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k417.9M1.7k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

565323.7M35](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k11.7M157](/packages/cuyz-valinor)[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)

PHPackages © 2026

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