PHPackages                             rbdwllr/reallysimplecollection - 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. rbdwllr/reallysimplecollection

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

rbdwllr/reallysimplecollection
==============================

A simple collection library for PHP.

0.1.0(8y ago)1219MITPHPPHP &gt;=7.0.0

Since May 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/RobDWaller/ReallySimpleCollection)[ Packagist](https://packagist.org/packages/rbdwllr/reallysimplecollection)[ RSS](/packages/rbdwllr-reallysimplecollection/feed)WikiDiscussions master Synced 1mo ago

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

Really Simple Collection
========================

[](#really-simple-collection)

[![Build Status](https://camo.githubusercontent.com/25c95c8753b330b5e7466bf75d15f4851fd2c303789136005f4f48dd0cf25c49/68747470733a2f2f7472617669732d63692e6f72672f526f624457616c6c65722f5265616c6c7953696d706c65436f6c6c656374696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/RobDWaller/ReallySimpleCollection) [![codecov](https://camo.githubusercontent.com/8bbc7d0a231ca3416ce08d4238bc2add1e0b40980f7eaeda35f9f1e115fa6f1b/68747470733a2f2f636f6465636f762e696f2f67682f526f624457616c6c65722f5265616c6c7953696d706c65436f6c6c656374696f6e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/RobDWaller/ReallySimpleCollection) [![StyleCI](https://camo.githubusercontent.com/4090a5477e37af63421abe07c4838ac2e23eb2221780c7f7af73103b28b23710/68747470733a2f2f7374796c6563692e696f2f7265706f732f39303532333633332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/90523633)

A very simple PHP collection library that helps you turn arrays into collections. Provides lots of useful methods such as first, map, filter, etc.

Usage
-----

[](#usage)

To use the collection just pass an array into the new instance of the collection class.

```
use ReallySimple\Collection;

$items = ['item1', 'item2', 'item3'];

$collection = new Collection($items);

echo $collection->count(); // Will Output 3.
```

You can also create the collection statically.

```
use ReallySimple\Collection;

$items = ['item1', 'item2', 'item3'];

$collection = Collection::make($items);

echo $collection->count(); // Will Output 3.
```

Methods Available
-----------------

[](#methods-available)

The following methods are currently available for this collection library.

```
// Return the number of items in the collection
$collection->count(): int;

// Return the current item the collection pointer is on
$collection->current();

// Filter the collection based on the values and return a new collection
$collection->filter(callable $callback): Collection;

// Filter the collection based on the keys and return a new collection
$collection->filterKeys(callable $callback): Collection;

// Filter the collection based on the keys and values and return a new collection
$collection->filterKeysValues(callable $callback): Collection;

// Return the first item from the collection
$collection->first();

// Return the current key the collection pointer is on
$collection->key();

// Map the collection and return a new collection
$collection->map(callable $callback): Collection;

// Move the collection point forward by one and return value
$collection->next();

// Return the collection pointer to the start of the collection
$collection->rewind();

// Reduce the collection and return a new collection
$collection->reduce(callable $callback, $initial = null): Collection;

// Return the collection as an array
$collection->toArray(): array;

// Check the collection key is valid
$collection->valid(): bool;
```

Author
------

[](#author)

- Rob Waller
- [@RobDWaller](https://twitter.com/RobDWaller)
- [Website](https://rbrt.wllr.info)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

2921d ago

PHP version history (2 changes)0.1-alphaPHP &gt;=5.6.0

0.1-alpha.1PHP &gt;=7.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/634080?v=4)[Rob Waller](/maintainers/RobDWaller)[@RobDWaller](https://github.com/RobDWaller)

---

Top Contributors

[![RobDWaller](https://avatars.githubusercontent.com/u/634080?v=4)](https://github.com/RobDWaller "RobDWaller (20 commits)")

---

Tags

arraycollectionphpphparraycollectionpipeline

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rbdwllr-reallysimplecollection/health.svg)

```
[![Health](https://phpackages.com/badges/rbdwllr-reallysimplecollection/health.svg)](https://phpackages.com/packages/rbdwllr-reallysimplecollection)
```

###  Alternatives

[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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