PHPackages                             gedex/container - 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. gedex/container

ActiveLibrary

gedex/container
===============

Library for various data structure and its operations

06PHP

Since Aug 3Pushed 10y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Container
=========

[](#container)

[![Build Status](https://camo.githubusercontent.com/8bbada5b7e2858326aef8e211a1d8f99ab97f24c140a41b68da53f4e5e5b2382/68747470733a2f2f7472617669732d63692e6f72672f67656465782f636f6e7461696e65722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/gedex/container)[![Coverage Status](https://camo.githubusercontent.com/1f68a0a74e6b689cfdc207986fdf335b495bc6eb3db7a15e6d7ae783a99da34b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f67656465782f636f6e7461696e65722f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/gedex/container?branch=master)

Library for various data structure and its operations.

Examples
--------

[](#examples)

### Doubly Linked List

[](#doubly-linked-list)

```
use Gedex\Container;

$ll = new Container\DoublyLinkedList();
$e1 = $ll->pushFront(1);
$e2 = $ll->pushFront(2);
$e3 = $ll->pushBack('e3');

$e4 = $ll->insertBefore('el before e3', $e3);
$e5 = $ll->insertAfter('el after e3', $e3);
printList($ll); // --> (2) --> (1) --> (el before e3) --> (e3) --> (el after e4)

printf("Remove element (%s)\n", $e3->getValue());
$ll->remove($e3);

printList($ll); // --> (2) --> (1) --> (el before e3) --> (el after e4)

function printList($ll) {
    $el = $ll->getFront();
    while (!is_null($el)) {
        printf('--> (%s) ', $el->getValue());
        $el = $el->getNext();
    }
    printf("\n");
}
```

### Circular List

[](#circular-list)

```
use Gedex\Container;

$cl = new Container\CircularList(5);
for ($i = 1; $i len(); $i++) {
    $el = $cl->cursor()->setValue($i);
    $cl->next();
}

$sum = 0;
$cl->walk(function($value) use(&$sum) {
    printf('--> (%s) ', $value);
    $sum += $value;
});
printf("\n");
printf("%d\n", $sum); // 15
```

License
-------

[](#license)

MIT License - See [LICENSE file](LICENSE).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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://www.gravatar.com/avatar/dc9dd485942002d2de369dee002498b5e0811eac2bcf727b8984fa89a99be43c?d=identicon)[gedex](/maintainers/gedex)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/gedex-container/health.svg)

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

PHPackages © 2026

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