PHPackages                             dormilich/extended-array-object - 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. dormilich/extended-array-object

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

dormilich/extended-array-object
===============================

Bringing array functions to the ArrayObject

v1.5.0(10y ago)318[1 issues](https://github.com/Dormilich/extended-array-object/issues)GPL v2.0PHPPHP &gt;=5.4.0

Since Apr 8Pushed 10y ago2 watchersCompare

[ Source](https://github.com/Dormilich/extended-array-object)[ Packagist](https://packagist.org/packages/dormilich/extended-array-object)[ RSS](/packages/dormilich-extended-array-object/feed)WikiDiscussions master Synced 1mo ago

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

extended-array-object
=====================

[](#extended-array-object)

PHP’s array functions brought into php objects.

The intention of this project is to extend the native `ArrayObject` with further array functions and provide an easy way to apply subsequent array operations (like filter, map, diff, intersect) in a concise way.

So far the spotlight is on working with single dimensional arrays. Recursive functions may be included in another project.

Function Overview
-----------------

[](#function-overview)

the following functions are supported:

### Functions with identical behaviour and syntax

[](#functions-with-identical-behaviour-and-syntax)

- `array_change_key_case()` as `changeKeyCase()`
- `in_array()` as `contains()`
- `array_count_values()` as `countValues()`
- `array_filter()` as `filter()`
- `array_flip()` as `flip()`
- `implode()` as `join()`
- `array_keys()` as `keys()`
- `array_pop()` as `pop()`
- `array_push()` as `push()`
- `array_reverse()` as `reverse()`
- `array_search()` as `search()`
- `array_shift()` as `shift()`
- `shuffle()`
- `array_slice()` as `slice()`
- `array_splice()` as `splice()`
- `array_unique()` as `unique()`
- `array_unshift()` as `unshift()`
- `array_values()` as `values()`

Some methods have been renamed to better describe their functionality

- `array_merge()` as `concat()`
- `array_replace()` as `merge()`

### Functions with slightly modified behaviour or syntax

[](#functions-with-slightly-modified-behaviour-or-syntax)

- `array_map()` as `map()`, it does no accept multiple arrays. Instead it will always pass the keys and values to the callback.
- `array_rand()` as `rand()`, it returns the array elements instead of only the keys.
- `array_reduce()` as `reduce()`, if no initial value is given, the first array element is used as initial value.
- `*sort()`, the native sort methods (ksort/asort) are extended to return the object instance.
- `array_walk()` as `walk()`, if no userdata are given, the array itself is injected as userdata.

### Functions with drastically changed behaviour or syntax

[](#functions-with-drastically-changed-behaviour-or-syntax)

- `array_diff_*()` as `diff()`, `kdiff()`, and `adiff()`
- `array_intersect_*()` as `intersect()`, `kintersect()`, and `aintersect()`
- `replace()` is a new function that works like `array_replace()` only without appending excess data.

Improved Error Handling
-----------------------

[](#improved-error-handling)

All methods throw exceptions when they encounter an error. This effectively allows to chain the methods together.

Examples
--------

[](#examples)

- Filtering for duplicate data in a POST variable

```
use Dormilich\Core\ArrayObject;

try {
    $duplicates = ArrayObject::from($_POST['group'])
        ->map(function ($item) {
            return $item['name'];
        })
        ->countValues()
        ->filter(function ($count) {
            return $count > 1;
        })
        ->map(function ($count, $name) {
            return sprintf('%d× %s', $count, $name);
        })
    ;

    if (count($duplicates)) {
        $error_string = 'Duplicate names: ' . $duplicates->join(', ');
    }
}
catch (Exception $exc) {
    error_log($exc->getMessage());
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

Total

8

Last Release

3778d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/392135?v=4)[Bertold von Dormilich](/maintainers/Dormilich)[@Dormilich](https://github.com/Dormilich)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dormilich-extended-array-object/health.svg)

```
[![Health](https://phpackages.com/badges/dormilich-extended-array-object/health.svg)](https://phpackages.com/packages/dormilich-extended-array-object)
```

###  Alternatives

[symplify/vendor-patches

Generate vendor patches for packages with single command

1876.7M27](/packages/symplify-vendor-patches)[muffin/orderly

Default ordering (behavior) for CakePHP

22217.3k1](/packages/muffin-orderly)[hughgrigg/php-business-time

Business time / working days extension for Carbon dates

3330.5k](/packages/hughgrigg-php-business-time)[liberu-genealogy/php-dna

DNA analysis toolkit for PHP 8.3+

334.3k1](/packages/liberu-genealogy-php-dna)[sciactive/hookphp

Method hooking in PHP.

333.0k3](/packages/sciactive-hookphp)

PHPackages © 2026

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