PHPackages                             tasoft/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tasoft/collection

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

tasoft/collection
=================

v8.0.1(3y ago)06134MITPHPPHP &gt;=8.0CI failing

Since Apr 6Pushed 3y agoCompare

[ Source](https://github.com/tasoftch/php-collection)[ Packagist](https://packagist.org/packages/tasoft/collection)[ RSS](/packages/tasoft-collection/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (4)

PHP Collection Library
======================

[](#php-collection-library)

Works with arrays and offers you a bunch of features:

- Order collections with several sort descriptors

```
$collection = new DefaultCollection(
  [
    "echo",
    "alpha",
    "delta",
    "charlie",
    "bravo"
  ]
);
$collection->sort([
  new DefaultSortDescriptor(true) // Sort ascending
]);

print_r( $collection->toArray() ); // [alpha, bravo, charlie, delta, echo]
```

- Create tagged collections, so each element can have tags

```
$collection = new TaggedCollection([1, 2, 3], /* accept duplicates */ true, /*case sensitive*/ true, /* tags ...*/ "test", "haha");

print_r($collection["test"]); // [1, 2, 3]
print_r($collection["unexisting tag"]); // NULL -- without notice
```

- Create priority collections that are ordered automatically against element priority

```
$collection = new PriorityCollection();
$collection->add(3, [5, 7]);
$collection->add(1, 8, 7);
$collection->add(7, 11, 3);

print_r($collection->toArray()); // [8, 7, [5, 7], 11, 3]
```

- Create dependency collection, elements can depend on others

```
$collection = new DependencyCollection();
$collection->add('thomas', 1, ["Foo", 'Bar']);
$collection->add('Foo', 2);
$collection->add("Bar", 3, ["Foo"]);
$collection->add("Bettina", 6, ["thomas"]);

print_r($collection->getElementDependencies("thomas")); // [Foo, Bar]
print_r($collection->getOrderedElements());
/*
[
  Foo => 1,
  Bar => 3,
  thomas => 1
  Bettina => 6
]
*/
```

Simply install it with composer:

```
$ composer require tasoft/collection

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

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

Total

5

Last Release

1194d ago

Major Versions

v0.9.1-alpha → v1.0.02020-04-13

v1.0.1 → v8.0.02023-02-05

PHP version history (2 changes)v0.9.1-alphaPHP ^7

v8.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7b1a2883faeab6f2b9558df70ce847c9e7dc3467a64db4f694e0716e842e9f2?d=identicon)[tasoft](/maintainers/tasoft)

---

Top Contributors

[![tasoftch](https://avatars.githubusercontent.com/u/24875322?v=4)](https://github.com/tasoftch "tasoftch (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[scheb/tombstone

Dead code detection with tombstones for PHP

282578.2k2](/packages/scheb-tombstone)

PHPackages © 2026

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