PHPackages                             cancio-labs/php-queue - 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. cancio-labs/php-queue

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

cancio-labs/php-queue
=====================

Interface and an array-based implementation of the FIFO Queue data structure.

v1.1.0(1y ago)04GPL-3.0-or-laterPHPPHP ^8.1

Since Mar 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/canciolabs/php-queue)[ Packagist](https://packagist.org/packages/cancio-labs/php-queue)[ RSS](/packages/cancio-labs-php-queue/feed)WikiDiscussions 1.1 Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

CancioLabs / DS / PHP-Queue
===========================

[](#canciolabs--ds--php-queue)

This tiny package contains an interface and an array-based implementation of the FIFO Queue data structure.

Interface
---------

[](#interface)

The Queue interface extends both Countable and IteratorAggragate interfaces, so it's possible to use a queue object inside the count function and foreach loop.

### Methods

[](#methods)

MethodDescriptionenqueueAdds a new element to the back of the queue.dequeueRemoves and return the front element from the queue.backReturns the back element of the queue.frontReturns the front element of the queue.isEmptyTests whether the queue is empty.clearRemoves all elements from the queue.countReturns the number of elements of the queue.getIteratorReturns a QueueIterator.toArrayTransforms the queue into an array.How to use it
-------------

[](#how-to-use-it)

```
use CancioLabs\Ds\Queue\Queue;

$queue = new Queue(['A', 'B']);

$queue->enqueue('C');
$queue->enqueue('D');

$queue->isEmpty(); // returns false
$queue->count(); // returns 4
count($queue) // returns 4

$queue->front(); // output 'A'
$queue->back(); // output 'D'
$queue->dequeue(); // output 'A'

$array = $queue->toArray(); // returns ['B', 'C', 'D']

foreach ($queue as $element) {
    // i=0: $element = 'B'
    // i=1: $element = 'C'
    // i=2: $element = 'D'
}

$queue->isEmpty(); // returns true

```

Tests and Coverage
------------------

[](#tests-and-coverage)

All tests are passing with no warnings and code coverage is 100%.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

4

Last Release

521d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65afdceff66eba436390f0041cd197dfef88b72f96a719e11477c315eb797ebb?d=identicon)[nilosoares](/maintainers/nilosoares)

---

Top Contributors

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

---

Tags

queuedsdata structure

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cancio-labs-php-queue/health.svg)

```
[![Health](https://phpackages.com/badges/cancio-labs-php-queue/health.svg)](https://phpackages.com/packages/cancio-labs-php-queue)
```

###  Alternatives

[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.6k132.3M1.0k](/packages/php-amqplib-php-amqplib)[ramsey/collection

A PHP library for representing and manipulating collections.

1.2k528.4M93](/packages/ramsey-collection)[queue-interop/queue-interop

Promoting the interoperability of MQs objects. Based on Java JMS

48131.8M96](/packages/queue-interop-queue-interop)[phootwork/collection

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

3928.2M15](/packages/phootwork-collection)[apinstein/jqjobs

Async job manager for PHP.

3220.2k](/packages/apinstein-jqjobs)

PHPackages © 2026

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