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

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

kusabi/arrays
=============

A library that extends PHP's native array functionality

1.0.7(1y ago)1175mitPHPPHP &gt;=7.2CI passing

Since Aug 21Pushed 1mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (9)Used By (0)

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

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

[![Tests](https://github.com/kusabi/arrays/workflows/quality/badge.svg)](https://github.com/kusabi/arrays/workflows/quality/badge.svg)[![codecov](https://camo.githubusercontent.com/dd9d8387d685e1f3d27b08dd49d0df3433275af69d50ebf3fb27bd2e79e5fdd6/68747470733a2f2f636f6465636f762e696f2f67682f6b75736162692f6172726179732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/kusabi/arrays)[![Licence Badge](https://camo.githubusercontent.com/94d022b6dc5de70d9cb4ee87ab22149d39d302c05db32a9a00c88f934683b146/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b75736162692f6172726179732e737667)](https://img.shields.io/github/license/kusabi/arrays.svg)[![Release Badge](https://camo.githubusercontent.com/c30fe43a92f838de33a5a116e4608f085b8414f6bc803a51ecaeb126a307860f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b75736162692f6172726179732e737667)](https://img.shields.io/github/release/kusabi/arrays.svg)[![Tag Badge](https://camo.githubusercontent.com/a45e602848f5f46295008976625d23022fe55ad9a1ca3410bc244c54d92d36e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6b75736162692f6172726179732e737667)](https://img.shields.io/github/tag/kusabi/arrays.svg)[![Issues Badge](https://camo.githubusercontent.com/00ad1c4143ba4d1e495d0420e00b1c7d4e1cba68995524937ccd49deee596bd5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6b75736162692f6172726179732e737667)](https://img.shields.io/github/issues/kusabi/arrays.svg)[![Code Size](https://camo.githubusercontent.com/1375d8b71ef9e8683fbeb051ace1b5fb0b697752106577b8b765fa9f3faa0e1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6b75736162692f6172726179732e7376673f6c6162656c3d73697a65)](https://img.shields.io/github/languages/code-size/kusabi/arrays.svg)

A library that extends PHP's native array functionality

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

[](#compatibility-and-dependencies)

This library is compatible with PHP version `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3` and `8.4`

This library has no dependencies.

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

[](#installation)

Installation is simple using composer.

```
composer require kusabi/arrays
```

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

```
{
    "require": {
        "kusabi/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
```

or

```
composer run test
```

#### 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
```

or

```
composer run fix
```

#### Static Analyses

[](#static-analyses)

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

```
vendor/bin/phan
```

or

```
composer run static
```

#### 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
```

or

```
composer run bench
```

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\_find](documentation/array_find.md)Return the first item that matches the predicate callback[array\_first](documentation/array_first.md)Get the first item from the array[array\_from](documentation/array_from.md)Attempt to convert an input into an array[array\_from\_query](documentation/array_from_query.md)Convert a URL query string to an 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\_is\_list](documentation/array_is_list.md)Checks whether a given array is a list[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\_only](documentation/array_only.md)Return a subset of the array by passing in an array of keys to keep[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\_to\_query](documentation/array_to_query.md)Convert an array to a URL query string[array\_unset](documentation/array_unset.md)Remove a key in the array using dot notation for nested arrays

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance67

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Recently: every ~192 days

Total

8

Last Release

593d 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 (18 commits)")

---

Tags

arrayarraysphpphparrays

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/kusabi-arrays/health.svg)](https://phpackages.com/packages/kusabi-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)
