PHPackages                             petrgrishin/array-access - 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. petrgrishin/array-access

ActiveLibrary

petrgrishin/array-access
========================

PHP multi array access

2.2.0(11y ago)235.2k13MITPHPPHP &gt;=5.3.0

Since May 4Pushed 10y ago4 watchersCompare

[ Source](https://github.com/petrgrishin/array-access)[ Packagist](https://packagist.org/packages/petrgrishin/array-access)[ RSS](/packages/petrgrishin-array-access/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (3)

array-access
============

[](#array-access)

[![Travis CI](https://camo.githubusercontent.com/b7a92714e36abd1f384c853f410fbed3a33c5e02cde1ad918d14849ac7a08f0b/68747470733a2f2f7472617669732d63692e6f72672f706574726772697368696e2f61727261792d6163636573732e706e67 "Travis CI")](https://travis-ci.org/petrgrishin/array-access)[![Coverage Status](https://camo.githubusercontent.com/42287eeb1b1b7f4d9a6395475ad49ff577e51dfd4f3194b7a9a584dd17415654/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f706574726772697368696e2f61727261792d6163636573732f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/petrgrishin/array-access?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/0c31ff8f7aa8f0424d5c3277d39eedad9136d45eae85db571f2480b7e06da63e/68747470733a2f2f706f7365722e707567782e6f72672f706574726772697368696e2f61727261792d6163636573732f762f737461626c652e737667)](https://packagist.org/packages/petrgrishin/array-access)[![Total Downloads](https://camo.githubusercontent.com/679d262fba64224915a6add0c66380e852062034b503e1bc97125a5a85eb5083/68747470733a2f2f706f7365722e707567782e6f72672f706574726772697368696e2f61727261792d6163636573732f646f776e6c6f6164732e737667)](https://packagist.org/packages/petrgrishin/array-access)[![License](https://camo.githubusercontent.com/7a4dac4427b3704fc1634072a5be46058ab54252ac107e20606fa89374cc33ab/68747470733a2f2f706f7365722e707567782e6f72672f706574726772697368696e2f61727261792d6163636573732f6c6963656e73652e737667)](https://packagist.org/packages/petrgrishin/array-access)

PHP multi array access

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

[](#installation)

Add a dependency to your project's composer.json file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project:

```
{
    "require": {
        "petrgrishin/array-access": "~2.0"
    }
}
```

Usage examples
--------------

[](#usage-examples)

#### Basic usage array-access objects

[](#basic-usage-array-access-objects)

```
use \PetrGrishin\ArrayAccess\ArrayAccess;

$arrayParams = array(
    'a' => array(
        'b' => 10,
    )
);
$params = ArrayAccess::create($arrayParams);
$value = $params->getValue('a.b');
$params
    ->setValue('a.b', 20)
    ->setValue('a.c', 30);
$params->remove('a.b');
$resultArrayParams = $params->getArray();
// array(
//     'a' => array(
//         'c' => 30,
//     )
// )
```

#### Use ArrayMap

[](#use-arraymap)

```
$arrayAccess = ArrayAccess::create($array);
$arrayAccess->getMap()
    ->filter($callback)
    ->map($callback)
    ->userSortByValue($callback)
    ->userSortByKey($callback)
    ->mergeWith($array)
    ->replaceWith($array);
$resultArrayParams = $arrayAccess->getArray();
```

Example of usage ArrayMap class —

#### Example of usage in Yii2 behavior

[](#example-of-usage-in-yii2-behavior)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~10 days

Total

8

Last Release

4324d ago

Major Versions

1.2.0 → 2.0.02014-06-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/580229?v=4)[Petr Grishin](/maintainers/petrgrishin)[@petrgrishin](https://github.com/petrgrishin)

---

Top Contributors

[![petrgrishin](https://avatars.githubusercontent.com/u/580229?v=4)](https://github.com/petrgrishin "petrgrishin (56 commits)")[![dsxack](https://avatars.githubusercontent.com/u/683183?v=4)](https://github.com/dsxack "dsxack (1 commits)")

---

Tags

arrayarray-mapchangingphpyiiyii2

### Embed Badge

![Health badge](/badges/petrgrishin-array-access/health.svg)

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

###  Alternatives

[petrgrishin/array-map

The object oriented approach to working with arrays on PHP

125.8k1](/packages/petrgrishin-array-map)

PHPackages © 2026

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