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

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

chebur/array-functions
======================

Functions dealing with arrays

1.1.0(4y ago)110.0k[1 issues](https://github.com/vchebotarev/array-functions/issues)MITPHPPHP ^7.4 || ^8.0

Since Nov 27Pushed 4y ago1 watchersCompare

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

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

array functions
===============

[](#array-functions)

[![PHP requirements](https://camo.githubusercontent.com/4ab58980c0b79fe012e707312d8605d203cd32140dbe0ea21e7b256ac35fd0bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6368656275722f61727261792d66756e6374696f6e732e737667)](https://packagist.org/packages/chebur/array-functions "PHP requirements")[![Latest version](https://camo.githubusercontent.com/cccacce02ac2a435a8501a622ea48458de9cab0cd8460f888350090f06aabc01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368656275722f61727261792d66756e6374696f6e732e737667)](https://packagist.org/packages/chebur/array-functions "Last version")[![Total downloads](https://camo.githubusercontent.com/d4cb0ca86540f0cefc297cbbc56cf7723ce4356d3229042eda5e1e1b30d496ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368656275722f61727261792d66756e6374696f6e732e737667)](https://packagist.org/packages/chebur/array-functions "Total downloads")[![License](https://camo.githubusercontent.com/7a09327b2030e4b14a87636706d5a4a1e8085c0f9146cbbde719e87c6b25c82b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6368656275722f61727261792d66756e6374696f6e732e737667)](https://packagist.org/packages/chebur/array-functions "License")

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

[](#installation)

Require it with composer:

```
composer require chebur/array-functions
```

Functions list
--------------

[](#functions-list)

- [array\_map\_key](#array_map_key)
- [array\_value\_first](#array_value_first)
- [array\_value\_last](#array_value_last)
- [array\_value](#array_value)
- [array\_value\_string](#array_value_string)
- [array\_value\_int](#array_value_int)
- [array\_value\_bool](#array_value_bool)
- [array\_value\_float](#array_value_float)
- [array\_value\_array](#array_value_array)

### array\_map\_key

[](#array_map_key)

Function works the practically the same as `array_map` but it applies the callback to the *KEYS* of the given array.

```
$array = [
    0 => 10,
    1 => 20,
    2 => 30,
];
$result = array_map_key(function($key, $value) {}, $array);
```

`print_r($result);` returns:

```
Array ( [11] => 10 [22] => 20 [33] => 30 )

```

### array\_value\_first

[](#array_value_first)

Function described in [PHP RFC](https://wiki.php.net/rfc/array_key_first_last) but was not accepted.
Returns the first element of an array or `NULL` if an array is empty.

### array\_value\_last

[](#array_value_last)

Function described in [PHP RFC](https://wiki.php.net/rfc/array_key_first_last) but was not accepted.
Returns the last element of an array or `NULL` if an array is empty.

### array\_value

[](#array_value)

Returns element of an array by key otherwise null.

### array\_value\_string

[](#array_value_string)

Returns *ONLY STRING* element of an array by key otherwise null.

### array\_value\_int

[](#array_value_int)

Returns *ONLY INTEGER* element of an array by key otherwise null.

### array\_value\_bool

[](#array_value_bool)

Returns *ONLY BOOL* element of an array by key otherwise null.

### array\_value\_float

[](#array_value_float)

Returns *ONLY FLOAT* element of an array by key otherwise null.

### array\_value\_array

[](#array_value_array)

Returns *ONLY ARRAY* element of an array by key otherwise null.

License
-------

[](#license)

See [LICENSE](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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

Total

5

Last Release

1583d ago

Major Versions

0.1.0 → 1.0.02019-12-02

PHP version history (2 changes)0.0.1PHP ^7.1.3

1.1.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bf9046069b7d485fc6a2df5411cd2089a6154a831ea480d96261e28aed35983?d=identicon)[vchebotarev](/maintainers/vchebotarev)

---

Top Contributors

[![vchebotarev](https://avatars.githubusercontent.com/u/2445241?v=4)](https://github.com/vchebotarev "vchebotarev (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[code-tool/jaeger-client-php

35520.8k9](/packages/code-tool-jaeger-client-php)[tatter/patches

Automated project updates for CodeIgniter 4

3588.4k3](/packages/tatter-patches)

PHPackages © 2026

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