PHPackages                             brenoroosevelt/array-functions - 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. brenoroosevelt/array-functions

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

brenoroosevelt/array-functions
==============================

A set of helpful array/iterables functions

1.0.0(4y ago)0741MITPHPPHP ^7.4|^8.0|^8.1

Since Feb 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/brenoroosevelt/php-array-functions)[ Packagist](https://packagist.org/packages/brenoroosevelt/array-functions)[ Docs](https://github.com/brenoroosevelt/php-array-functions)[ RSS](/packages/brenoroosevelt-array-functions/feed)WikiDiscussions main Synced 1mo ago

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

PHP Array Functions
===================

[](#php-array-functions)

[![CI Build](https://github.com/brenoroosevelt/php-array-functions/actions/workflows/ci.yml/badge.svg)](https://github.com/brenoroosevelt/php-array-functions/actions/workflows/ci.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3d00f987fadeaebdc76d9887c9893295befd23aeb8a7a92c5a360b1640ea4c32/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6272656e6f726f6f736576656c742f7068702d61727261792d66756e6374696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/brenoroosevelt/php-array-functions/?branch=main)[![codecov](https://camo.githubusercontent.com/f56f7d491bf64e586911a7d65489b0d5c5d25be6f67b365689678bef0e2c6682/68747470733a2f2f636f6465636f762e696f2f67682f6272656e6f726f6f736576656c742f7068702d61727261792d66756e6374696f6e732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d53315142413138494258)](https://codecov.io/gh/brenoroosevelt/php-array-functions)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)

A set of helpful array/iterables functions.

Requirements
------------

[](#requirements)

The following versions of PHP are supported: `7.4`, `8.0`, `8.1`.

Install
-------

[](#install)

```
$ composer require brenoroosevelt/array-functions
```

Available functions
-------------------

[](#available-functions)

```
// Add - Set
function add(array &$set, ...$elements): int
function set(array &$set, $element, $key = null): void

// Count
function all(iterable $items, callable $callback, bool $empty_is_valid = true, int $mode = CALLBACK_USE_VALUE): bool
function at_least(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool
function at_most(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool
function exactly(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool
function none(iterable $items, callable $callback, int $mode = 0): bool
function some(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool
function contains(iterable $items, ...$elements): bool

// Filter - Extract
function accept(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array
function reject(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array
function only(array $items, ...$keys): array
function except(array $items, ...$keys): array
function first(iterable $items, callable $callback, $default = null, int $mode = CALLBACK_USE_VALUE)

// Key - Index
function has(array $haystack, $key, ...$keys): bool
function index_of(iterable $haystack, $element, bool $strict = true)

// Remove - Pull
function pull(array &$set, $key, $default = null)
function remove(array &$set, ...$elements): int
function remove_key(array &$set, $key, ...$keys): int

// Miscellaneous
function map(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array
function paginate(array $items, int $page, int $per_page, bool $preserve_keys = true): array
function sum(iterable $items, callable $callback, int $mode = 0)

// Dot Notation
function flatten(array $items, ?string $pathSeparator = null): array
function expand(array $items, string $separator = '.'): array
function set_path(array &$haystack, string $path, $value, string $separator = '.'): void
function get_path(array $haystack, string $path, $default = null, string $separator = '.')
function unset_path(array &$haystack, string $path, string $separator = '.')
function has_path(array $haystack, string $path, string $separator = '.'): bool

// Pipeline
function pipe($payload, callable ...$stages)
function with(&$value, callable ...$jobs)
```

License
-------

[](#license)

This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE.md) file for license rights and limitations.

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

Unknown

Total

1

Last Release

1548d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82f73f1c4a1ebcd28bb29e832f0c9cd78a16bd0d57c501157ab2408bdd8817a7?d=identicon)[brenoroosevelt](/maintainers/brenoroosevelt)

---

Top Contributors

[![brenoroosevelt](https://avatars.githubusercontent.com/u/24551532?v=4)](https://github.com/brenoroosevelt "brenoroosevelt (173 commits)")

---

Tags

arrayat-leastat-mostdot-notationdot-notation-arrayfunctionsnonepaginatepaginate-arrayphpsomehelperarrayfunction

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/brenoroosevelt-array-functions/health.svg)

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

###  Alternatives

[laravelista/ekko

Framework agnostic PHP package for marking navigation items active.

278673.4k4](/packages/laravelista-ekko)[bocharsky-bw/arrayzy

A native PHP arrays easy manipulation library in OOP way.

38425.4k](/packages/bocharsky-bw-arrayzy)[spatie/array-functions

Some handy array helpers

24561.1k2](/packages/spatie-array-functions)[minwork/array

Pack of advanced array functions specifically tailored for: associative (assoc) array, multidimensional array, array of objects and handling nested array elements

66256.1k5](/packages/minwork-array)[clausnz/php-helpers

A Collection of useful php helper functions.

388.7k](/packages/clausnz-php-helpers)[bayfrontmedia/php-array-helpers

Helper class to provide useful array functions.

1413.4k23](/packages/bayfrontmedia-php-array-helpers)

PHPackages © 2026

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