PHPackages                             syaiful6/headbanger - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. syaiful6/headbanger

ActiveLibrary[Queues &amp; Workers](/categories/queues)

syaiful6/headbanger
===================

Headbanger! PHP Data structure

0.2.2(10y ago)037MITPHPPHP &gt;=5.6

Since May 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/syaiful6/headbanger)[ Packagist](https://packagist.org/packages/syaiful6/headbanger)[ Docs](https://github.com/syaiful6/hedobangya)[ RSS](/packages/syaiful6-headbanger/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

### Headbanger

[](#headbanger)

PHP data structure and or collections.

Motivation: PHP only give us array and object as compound type. There are no list, hash table, set, etc. Array on PHP doest it all. This make operation on array not predictable, is sometimes act as ordered set, list, ordered map. This package aim to provide some basic data structure to cover this gap.

### Install

[](#install)

`composer require syaiful6/headbanger`

This package contains implementations of Map, List, Set and Str. We consider string as container, because it can be accessed via array notation and when we want to iterate string, we actually want to iterate over character.

### Map

[](#map)

Python call this dict, Ruby call this type Hash. Whatever the name, this data type can 'map' key value pair. Typically the key are unique (within one map).

The main operations on a map are storing a value with some key and extracting the value given the key. It's also should possible to delete a key-value pair for the given key.

This package provide one implementation for this data type. `HashMap` that also implements Countable, Traversable and ArrayAccess. So you can treat this instance as array. To delete key-value pair use `unset($hash['somekey'])`

Note: `HashMap` is unordered map and not permit adding item during iteration, replacing a key-value is fine. Iterate over map will give you the key only, with this key you can access the value anyway. If you need the value use `values` method, if you need both use ```items`` method.

```
$map = new Headbanger\HashMap();
// Add item, or just give map your array or any traversable on constructor
$map['one'] = 1;
$map['two'] = 2;
$map['three'] = 3;
// deleting
unset($map['one']);
// check if item exists
isset($map['one']);

```

### List

[](#list)

A list or sequence, represents an ordered sequence of values, these values may occur more than once within on list. Think of it as finite sequence. Currently only one implementation provided: ArrayList. Using SplFixedArray as their storage.

You can use ArrayList as `Stack`, where the last element added is the first element retrieved (“last-in, first-out”). Use `push` to add item, and retrieve an item from the top use `pop` (without argument). However dont use ArrayList as Queue, they are not efficient for this purpose. But it possible.

### Set

[](#set)

A set is an unordered collection with no duplicate elements. The common operations are remove duplicates entries and membership testing. Set also support mathematical operations like union, intersection, difference, etc.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

9

Last Release

3683d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2830977?v=4)[Syaiful Bahri](/maintainers/syaiful6)[@syaiful6](https://github.com/syaiful6)

---

Top Contributors

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

---

Tags

queuesetcollectionsdata structure

### Embed Badge

![Health badge](/badges/syaiful6-headbanger/health.svg)

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

###  Alternatives

[ramsey/collection

A PHP library for representing and manipulating collections.

1.2k513.6M83](/packages/ramsey-collection)[php-amqplib/php-amqplib

Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.

4.6k129.9M974](/packages/php-amqplib-php-amqplib)[phootwork/collection

The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.

3927.1M15](/packages/phootwork-collection)[queue-interop/queue-interop

Promoting the interoperability of MQs objects. Based on Java JMS

48131.3M95](/packages/queue-interop-queue-interop)[apinstein/jqjobs

Async job manager for PHP.

3220.2k](/packages/apinstein-jqjobs)

PHPackages © 2026

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