PHPackages                             webfiori/collections - 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. webfiori/collections

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

webfiori/collections
====================

Basic collections set used by WebFiori.

2.0.2(1mo ago)364.1k↑2714.3%3MITPHPPHP &gt;=8.1CI passing

Since Sep 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/WebFiori/collections)[ Packagist](https://packagist.org/packages/webfiori/collections)[ RSS](/packages/webfiori-collections/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (3)

WebFiori Collections
====================

[](#webfiori-collections)

Basic data structures used by WebFiori framework.

 [ ![](https://github.com/WebFiori/collections/actions/workflows/php83.yaml/badge.svg?branch=main) ](https://github.com/WebFiori/collections/actions) [ ![](https://camo.githubusercontent.com/83122e44a2475b04b722713ee0249aaa5e9c79b2bd6cc76099a46f9b39caadb4/68747470733a2f2f636f6465636f762e696f2f67682f57656246696f72692f636f6c6c656374696f6e732f6272616e63682f6d61696e2f67726170682f62616467652e737667) ](https://codecov.io/gh/WebFiori/collections) [ ![](https://camo.githubusercontent.com/d356c6b13c53e3c786da8f150451948cd3ab135afce24359616d4abf7de48980/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d57656246696f72695f636f6c6c656374696f6e73266d65747269633d616c6572745f737461747573) ](https://sonarcloud.io/dashboard?id=WebFiori_collections) [ ![](https://camo.githubusercontent.com/8ec08250f9eb3f6d77f2663c0e31f5c6aafd50edd6c64b58dcf9a1876503a0f6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f636f6c6c656374696f6e732e7376673f6c6162656c3d6c6174657374) ](https://github.com/WebFiori/collections/releases) [ ![](https://camo.githubusercontent.com/bd36883d9952fc356636b4dfee0d7e71f49bd561b06c7c0818c475bbe55f2972/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656266696f72692f636f6c6c656374696f6e733f636f6c6f723d6c696768742d677265656e) ](https://packagist.org/packages/webfiori/collections) [![PHP 8.1+](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)

Table of Contents
-----------------

[](#table-of-contents)

- [Key Features](#key-features)
- [Supported PHP Versions](#supported-php-versions)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
    - [LinkedList](#linkedlist)
    - [Stack](#stack)
    - [Queue](#queue)
    - [Vector](#vector)
- [Advanced Usage](#advanced-usage)
- [API Reference](#api-reference)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)
- [Changelog](#changelog)

Key Features
------------

[](#key-features)

- **LinkedList** — Doubly-linked list with O(1) add/removeLast and full iterator support
- **Stack** — LIFO structure with O(1) push/pop
- **Queue** — FIFO structure with O(1) enqueue/dequeue
- **Vector** — Array-backed list with O(1) index access, `ArrayAccess`, and `JsonSerializable`
- All collections implement `Countable`
- Optional size limits on all collections
- Sorting support via `Comparable` interface

Supported PHP Versions
----------------------

[](#supported-php-versions)

Build Status[![](https://github.com/WebFiori/collections/actions/workflows/php81.yaml/badge.svg?branch=main)](https://github.com/WebFiori/collections/actions/workflows/php81.yaml)[![](https://github.com/WebFiori/collections/actions/workflows/php82.yaml/badge.svg?branch=main)](https://github.com/WebFiori/collections/actions/workflows/php82.yaml)[![](https://github.com/WebFiori/collections/actions/workflows/php83.yaml/badge.svg?branch=main)](https://github.com/WebFiori/collections/actions/workflows/php83.yaml)[![](https://github.com/WebFiori/collections/actions/workflows/php84.yaml/badge.svg?branch=main)](https://github.com/WebFiori/collections/actions/workflows/php84.yaml)Installation
------------

[](#installation)

```
composer require webfiori/collections
```

Quick Start
-----------

[](#quick-start)

```
