ds

Data Structures


Specialized data structures as efficient alternatives to the PHP array

License: MIT License

Latest releases

Version Release Download
2.0.0 2026-04-12 ds-2.0.0.tgz
1.8.0 2026-04-11 ds-1.8.0.tgz
1.6.0 2025-05-02 ds-1.6.0.tgz
1.5.0 2023-12-19 ds-1.5.0.tgz
1.4.0 2021-12-13 ds-1.4.0.tgz
Show all releases

Changelog

Version Message
2.0.0 - Major release: redesign from 11 types + 3 interfaces to 5 types + 1 interface
- New types: Ds\Seq, Ds\Map, Ds\Set, Ds\Heap, Ds\Pair (readonly)
- New interface: Ds\Key (replaces Ds\Hashable)
- Copy-on-Write: clone and copy() are O(1), mutation during iteration is safe
- Removed: Vector, Deque, Stack, Queue, PriorityQueue, Collection, Sequence, Hashable
- Ds\Heap accepts optional callable comparator in constructor
- Ds\Pair is a readonly class with public key and value properties
- Require PHP >= 8.2
1.8.0 - Drop PHP < 8.2, require PHP >= 8.2
- Implement __serialize/__unserialize (O: format), replacing Serializable (C:)
- Fix sort/ksort to accept null comparators (#134)
- Support nested sort comparators via FCI save/restore (#48)
- Guard allocate against negative capacity (#33)
- Update CI for PHP 8.2-8.5, PHPUnit 11 (#213)
- Remove legacy Serializable and pre-8.2 compat code
1.6.0 - Support for PHP 8.4 @simPod
1.5.0 - Support for PHP 8.3
- Fix #194 @nielsdos
- Fix #200 @nielsdos
1.4.0 - Support for PHP 8.1
Show complete changelog