PHPackages                             kamyshev/array\_actions - 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. kamyshev/array\_actions

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

kamyshev/array\_actions
=======================

Set of simple actions with arrays

v1.1.1(7y ago)41.9k1[1 issues](https://github.com/igorkamyshev/array_actions/issues)1MITPHPPHP &gt;=7.1

Since Oct 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/igorkamyshev/array_actions)[ Packagist](https://packagist.org/packages/kamyshev/array_actions)[ Docs](https://github.com/igorkamyshev/array_actions)[ RSS](/packages/kamyshev-array-actions/feed)WikiDiscussions master Synced 3d ago

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

array\_actions
==============

[](#array_actions)

> Set of simple actions with arrays

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

[](#installation)

To get the latest version of `array_actions`, simply require the project using Composer:

```
$ composer require kamyshev/array_actions
```

Usage
-----

[](#usage)

Actions list:

- [array\_find](#array_find)
- [array\_head](#array_head)

### array\_find

[](#array_find)

To use `array_find`, simply pass an array and callback:

```
$records = [
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'School bus',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'Manhole',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Plainfield',
        'object' => 'Basketball',
    ],
    [
        'state'  => 'CA',
        'city'   => 'San Diego',
        'object' => 'Light bulb',
    ],
    [
        'state'  => 'CA',
        'city'   => 'Mountain View',
        'object' => 'Space pen',
    ],
];

$found = array_find($records, function ($state) {
    return $state['city'] === 'San Diego';
});
```

Example output:

```
Array
(
    [state] => CA
    [city] => San Diego
    [object] => Light bulb
)

```

If the element was not found, `array_find` returns `null`.

### array\_head

[](#array_head)

To use `array_find`, simply pass an array and callback:

```
$records = [
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'School bus',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'Manhole',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Plainfield',
        'object' => 'Basketball',
    ],
    [
        'state'  => 'CA',
        'city'   => 'San Diego',
        'object' => 'Light bulb',
    ],
    [
        'state'  => 'CA',
        'city'   => 'Mountain View',
        'object' => 'Space pen',
    ],
];

$head = array_head($records);
```

Example output:

```
Array
(
    [state] => IN
    [city] => Indianapolis
    [object] => School bus
)

```

If the array is empty, `array_head` returns `null`.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2759d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v1.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb826bf7775f0574a417b011442f33dd0ec6c593ac2a10b7c7402520a5e4eaa4?d=identicon)[igor.kamyshev](/maintainers/igor.kamyshev)

---

Top Contributors

[![igorkamyshev](https://avatars.githubusercontent.com/u/26767722?v=4)](https://github.com/igorkamyshev "igorkamyshev (14 commits)")

---

Tags

arrayutilsarrayutils

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kamyshev-array-actions/health.svg)

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

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4875.5M16](/packages/voku-arrayy)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)

PHPackages © 2026

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