j45l/abstract-data-structures-php

Abstract data structures for PHP

4.0.4 2023-05-23 04:33 UTC

This package is auto-updated.

Last update: 2024-04-23 06:28:48 UTC


README

Immutable data structures

Persistent data structured, not optimized for big collections/arrays

All collection are typed, extend from the base type, set the allowed type by overriding abstract public function type(): string;, return must the desired type classname.

When a getter operation would produce a mutation, a two elements array is returned, the first element would be the modified collection, and the second one the got element.

$queue = Queue::fromArray([1, 2]);

Classes