PHPackages                             andydune/array-walker - 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. andydune/array-walker

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

andydune/array-walker
=====================

Better implementation foreach operator with nested array compability.

v1.0.0(7y ago)136MITPHPPHP &gt;=5.6CI failing

Since May 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/AndyDune/ArrayWalker)[ Packagist](https://packagist.org/packages/andydune/array-walker)[ Docs](https://github.com/AndyDune/ArrayWalker)[ RSS](/packages/andydune-array-walker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ArrayWalker
===========

[](#arraywalker)

[![Build Status](https://camo.githubusercontent.com/2694136741226de08a64cfdcf6ef42cd76bedc79dcc3cc1ade1fc00be7364f13/68747470733a2f2f7472617669732d63692e6f72672f416e647944756e652f417272617957616c6b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AndyDune/ArrayWalker)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/c5cdbbea4bef9cda1ac7540ca659e70720447a9b182214c066d14c028ad33765/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e647964756e652f61727261792d77616c6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andydune/array-walker)[![Total Downloads](https://camo.githubusercontent.com/14c67aa6e607728ea01b454c10fcb820aedf3a7c50a37f2072699739bac984e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e647964756e652f61727261792d77616c6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andydune/array-walker)

Better implementation foreach operator with nested array compability.

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

[](#installation)

Installation using composer:

```
composer require andydune/array-walker

```

Or if composer was not installed globally:

```
php composer.phar require andydune/array-walker

```

Or edit your `composer.json`:

```
"require" : {
     "andydune/array-walker": "^1"
}

```

And execute command:

```
php composer.phar update

```

Example
-------

[](#example)

```
use AndyDune\ArrayWalker\ArrayWalker;
use AndyDune\ArrayWalker\ItemContainer;

// Source array
$array = [
    'one' => 1,
    'two' => 2,
    'three' => 3,
];

$arrayWalker = new ArrayWalker($array);
// Change values
$arrayWalker->addFunction(function (ItemContainer $item) {
    $item->setValue($item->getValue() + 10);
});
$result = $arrayWalker->apply();
$result = [
    'one' => 11,
    'two' => 12,
    'three' => 13,
];

$arrayWalker = new ArrayWalker($array);
// Change keys
$arrayWalker->addFunction(function (ItemContainer $item) {
   $item->setKey(strtoupper($item->getKey()));
});
$result = $arrayWalker->apply();
$result = [
    'ONE' => 1,
    'TWO' => 2,
    'THREE' => 3,
];

$arrayWalker = new ArrayWalker($array);
// Delete value
$arrayWalker = new ArrayWalker($array);
$arrayWalker->addFunction(function (ItemContainer $item) {
    $item->setValue($item->getValue() + 10);
    if ($item->getKey() == 'one') {
        $item->delete();
    }
});
$result = $arrayWalker->apply();

$result = [
    'two' => 12,
    'three' => 13,
];
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2913d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79da3b2173a2cefb36abc9b4707cf2c633df8f2c748633ccf64186f5c0e7be6c?d=identicon)[AndyDune](/maintainers/AndyDune)

---

Top Contributors

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

---

Tags

arrayarray-manipulationsphpphp7phparray

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andydune-array-walker/health.svg)

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

###  Alternatives

[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)

PHPackages © 2026

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