All notable changes to this project will be documented in this file.
Ds\Seqas a unified sequence type, replacingDs\VectorandDs\Deque.Ds\Heapwith an optional comparator parameter (max-heap by default), replacingDs\PriorityQueue.Ds\Keyinterface for custom key equality (hash(): mixed,equals(mixed $other): bool), replacingDs\Hashable.- Copy-on-write (COW) semantics: cloning and iterating collections is safe during mutation. Clone is O(1), with the actual copy deferred until either side mutates.
- Functional constructors:
\Ds\seq(),\Ds\map(),\Ds\set(),\Ds\heap(). Ds\Pairis now readonly (properties cannot be set or unset).- PHPT tests alongside the existing PHPUnit shared test suite.
- Requires PHP >= 8.2.
Ds\Map::values()now returnsDs\Seqinstead ofDs\Vector.Ds\Map::pairs()now returnsDs\Seqinstead ofDs\Vector.Ds\Map::keys()now returnsDs\Set.
Ds\Vector(useDs\Seq).Ds\Deque(useDs\Seq).Ds\Stack(useDs\Seqwithpush/pop).Ds\Queue(useDs\Seqwithpush/shift).Ds\PriorityQueue(useDs\Heap).Ds\Hashableinterface (useDs\Key).Ds\Collectioninterface.Ds\Sequenceinterface.Ds\Pair::copy()(useclone).
- Support for PHP 8.4 @simPod
- Support for PHP 8.3
- Fix #194 @nielsdos
- Fix #200 @nielsdos
- ArrayAccess implemented consistently
- IteratorAggregate implemented consistently
- A few incorrect return types
- ArrayAccess implemented consistently
- IteratorAggregate implemented consistently
- A few incorrect return types
- Segfault when iterating an implicit instance of Stack, Queue or PriorityQueue
- Fixed buffer outflow during deserialization of map objects. #132 @rado-h
- Fixed pair reflection bugs. #119
- Fixed not clearing memory after buffer reallocation. #114
- Buffer outflow during deserialization of objects. #111
- Empty
PriorityQueuecausing segfault ongc_collect_cycles. #106
- Memory allocation bug on ppc64. @remicollet #88
- Segfault in ds_htable_lookup_bucket_by_hash. @gnoddep #86
- Minor capacity adjustments.
- Vector's minimum and default capacity down from 10 to 8.
- Map and Set's minimum and default capacity down from 16 to 8.
- Hash function of arrays is now the length of the array, so O(1).
- Using a key as reference not working correctly with array access. #86
- Iterating over an implicit iterator (not variable). #82
- PriorityQueue automatic truncate bug. #78
- Bugs related to unserialization. #77
- Preliminary support for PHP 7.2
Maptruncating to capacity less than the minimum.
phpinfoheaderds_htable_put_distinctwasn't rehashing the correct bucket pointer (Fixes #53)- Memory leaks.
VectorandDequerotate crashing when empty (mod zero).
- Memory leaks during map when callback throws an exception.
- Memory leaks when structures contain themselves.
- Module dependencies.
- Version info in
phpinfo()
Map::mapandMap::filterare now slightly faster.
- Many, many memory leaks.
- Added memory checks to CI.
- Performance improvements.
- JSON dependency now handled correctly (thanks @nikic).
- Multiple memory leaks where objects were not free'd correctly.
Pair::copy
unserializememory leak when failed to unserialize.htablebucket copy macro didn't copy the bucket's "next".
Set::merge
- ds_htable_put_next bucket rehash fix
Map::putAll