PHPackages                             barogue/arrays - 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. barogue/arrays

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

barogue/arrays
==============

A library that extends PHP's native array functionality

1.0.6(2y ago)057↓50%1mitPHPPHP &gt;=8.1

Since Aug 24Pushed 2y agoCompare

[ Source](https://github.com/barogue/arrays)[ Packagist](https://packagist.org/packages/barogue/arrays)[ RSS](/packages/barogue-arrays/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (8)Used By (1)

Extensions to PHP native arrays
===============================

[](#extensions-to-php-native-arrays)

[![Tests](https://github.com/barogue/arrays/workflows/quality/badge.svg)](https://github.com/barogue/arrays/workflows/quality/badge.svg)[![codecov](https://camo.githubusercontent.com/b64aca6d62d446610f4a41a9412eadb07588c371eb318a39575765b8625ee809/68747470733a2f2f636f6465636f762e696f2f67682f6261726f6775652f6172726179732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/barogue/arrays)[![Licence Badge](https://camo.githubusercontent.com/ce204c1bb2dce62ee691662319062422cf075a0533505866d601627bb6c60cc2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6261726f6775652f6172726179732e737667)](https://img.shields.io/github/license/barogue/arrays.svg)[![Release Badge](https://camo.githubusercontent.com/e565238a5f6c275cb994c803de742898f325811a033679bee76dc0f8ad607642/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6261726f6775652f6172726179732e737667)](https://img.shields.io/github/release/barogue/arrays.svg)[![Tag Badge](https://camo.githubusercontent.com/ea6fe956c919142414170f2f70eefc0b6fbce7ed83a12b665e0270b49e000091/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6261726f6775652f6172726179732e737667)](https://img.shields.io/github/tag/barogue/arrays.svg)[![Issues Badge](https://camo.githubusercontent.com/71697672411ad0ca6b046fdf3958996b442da9738acecd8a796a4271927466ba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6261726f6775652f6172726179732e737667)](https://img.shields.io/github/issues/barogue/arrays.svg)[![Code Size](https://camo.githubusercontent.com/5d5d259a734ca113475e6368c7125322ce4a216a0d1c908a6e48eb9a9a857300/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6261726f6775652f6172726179732e7376673f6c6162656c3d73697a65)](https://img.shields.io/github/languages/code-size/barogue/arrays.svg)

A library that extends PHP's native array functionality

Compatibility and dependencies
------------------------------

[](#compatibility-and-dependencies)

This library is compatible with PHP version `8.1` and `8.2`.

This library has no dependencies.

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

[](#installation)

Installation is simple using composer.

```
composer require barogue/arrays
```

Or simply add it to your `composer.json` file

```
{
    "require": {
        "barogue/arrays": "^1.0"
    }
}
```

Contributing
------------

[](#contributing)

This library follows [PSR-1](https://www.php-fig.org/psr/psr-1/) &amp; [PSR-2](https://www.php-fig.org/psr/psr-2/) standards.

#### Unit Tests

[](#unit-tests)

Before pushing any changes, please ensure the unit tests are all passing.

If possible, feel free to improve coverage in a separate commit.

```
vendor/bin/phpunit
```

#### Code sniffer

[](#code-sniffer)

Before pushing, please ensure you have run the code sniffer. **Only run it using the lowest support PHP version (7.2)**

```
vendor/bin/php-cs-fixer fix
```

#### Static Analyses

[](#static-analyses)

Before pushing, please ensure you have run the static analyses tool.

```
vendor/bin/phan
```

#### Benchmarks

[](#benchmarks)

Before pushing, please ensure you have checked the benchmarks and ensured that your code has not introduced any slowdowns.

Feel free to speed up existing code, in a separate commit.

Feel free to add more benchmarks for greater coverage, in a separate commit.

```
vendor/bin/phpbench run --report=speed
vendor/bin/phpbench run --report=speed --output=markdown
vendor/bin/phpbench run --report=speed --filter=benchNetFromTax --iterations=50 --revs=50000

vendor/bin/phpbench xdebug:profile
vendor/bin/phpbench xdebug:profile --gui
```

Documentation
-------------

[](#documentation)

This library adds a number of array functions to extend PHP's native functionality

Below you can find links to the documentation for the new features.

FunctionDescription[array\_at](documentation/array_at.md)Get the nth value from an array[array\_deflate](documentation/array_deflate.md)Flattens a nested array into a single level array[array\_except](documentation/array_except.md)Return a subset of the array by passing in an array of keys to discard[array\_exists](documentation/array_exists.md)Checks if the given key or index exists in the array using dot notation for nested arrays[array\_first](documentation/array_first.md)Get the first item from the array[array\_first\_key](documentation/array_first_key.md)Get the first key from the array[array\_get](documentation/array_exists.md)Returns a value from the array, using dot notation for nested sets[array\_inflate](documentation/array_inflate.md)Expands a flattened array back into a nested array[array\_join](documentation/array_join.md)Joins entries of array into a string using optional glue substring and optional final glue substring[array\_key\_at](documentation/array_key_at.md)Get the nth key from an array[array\_last](documentation/array_last.md)Get the last entry in the array[array\_last\_key](documentation/array_last_key.md)Get the last key in the array[array\_only](documentation/array_only.md)Return a subset of the array by passing in an array of keys to keep[array\_pop\_many](documentation/array_pop_many.md)Pop multiple elements off the end of an array[array\_pull](documentation/array_pull.md)Return and remove a key in the array using dot notation for nested arrays[array\_random](documentation/array_random.md)Picks one or more random entries out of an array, and returns the value (or values) of the random entries[array\_set](documentation/array_set.md)Set a key in the array using dot notation for nested arrays[array\_shift\_many](documentation/array_shift_many.md)Shift multiple elements off the beginning of an array[array\_shuffle](documentation/array_shuffle.md)Shuffle an array, with an option to maintain keys or not[array\_unset](documentation/array_unset.md)Remove a key in the array using dot notation for nested arrays

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

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

Every ~1 days

Total

7

Last Release

993d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f4942978644437b5ff3d7bd3f6411580413d327b001104acd4914f43ab63b6?d=identicon)[kusabi](/maintainers/kusabi)

---

Top Contributors

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

---

Tags

phparraysbarogue

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/barogue-arrays/health.svg)

```
[![Health](https://phpackages.com/badges/barogue-arrays/health.svg)](https://phpackages.com/packages/barogue-arrays)
```

###  Alternatives

[ilya/belt

A handful of tools for PHP developers.

71020.8k1](/packages/ilya-belt)[glowy/arrays

Arrays Component provide a fluent, object-oriented interface for working with arrays, allowing you to chain multiple arrays operations together using a more readable syntax compared to traditional PHP arrays functions.

153.2k3](/packages/glowy-arrays)

PHPackages © 2026

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