PHPackages                             m1guelpf/native-collection - 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. m1guelpf/native-collection

ActiveLibrary

m1guelpf/native-collection
==========================

Adding Collection functions to the PHP array scalar type

150PHP

Since Sep 12Pushed 6y agoCompare

[ Source](https://github.com/m1guelpf/native-collection)[ Packagist](https://packagist.org/packages/m1guelpf/native-collection)[ RSS](/packages/m1guelpf-native-collection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Adding Collection functions to the PHP array scalar type
========================================================

[](#adding-collection-functions-to-the-php-array-scalar-type)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6fb5c50584769b621f332041e9159d4ce1674f6968b4de1c9ecfa5f9136d1e1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d316775656c70662f6e61746976652d636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/m1guelpf/native-collection)[![Build Status](https://camo.githubusercontent.com/e653fd8825d4279b5cbd01506d25cfa5f5ce640f8573cb3a3a478c1fc7d54931/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d316775656c70662f6e61746976652d636f6c6c656374696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/m1guelpf/native-collection)[![Quality Score](https://camo.githubusercontent.com/7c78ca3fbd95c8a53faabd9650e6bf78ddb1698bef77e575879b3b9d99b9564b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d316775656c70662f6e61746976652d636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/m1guelpf/native-collection)[![Total Downloads](https://camo.githubusercontent.com/45710e13d7bd67d592d589be4b8b3ef6d47382c7a0484f670c4b6021dc0d8a12/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d316775656c70662f6e61746976652d636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/m1guelpf/native-collection)

**WARNING: You'll need to install [this extension](https://github.com/nikic/scalar_objects) for this package to work**

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

[](#installation)

You can install the package via composer:

```
composer require m1guelpf/native-collection
```

Usage
-----

[](#usage)

```
['never-gonna-give-you' => 'up', 'never-gonna-let-you' => 'down']->each(function($lyric) {
    play($lyric)
})->reverse(); // returns array
```

### PHP5

[](#php5)

If you're using PHP5, you'll need to assign the array to a variable first:

```
$temporary = ['never-gonna-give-you' => 'up', 'never-gonna-let-you' => 'down']

$temporary->each(function($lyric) {
    play($lyric)
})->reverse(); // returns array
```

### Testing

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Miguel Piedrafita](https://github.com/m1guelpf)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23558090?v=4)[Miguel Piedrafita](/maintainers/m1guelpf)[@m1guelpf](https://github.com/m1guelpf)

---

Top Contributors

[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")

### Embed Badge

![Health badge](/badges/m1guelpf-native-collection/health.svg)

```
[![Health](https://phpackages.com/badges/m1guelpf-native-collection/health.svg)](https://phpackages.com/packages/m1guelpf-native-collection)
```

PHPackages © 2026

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