issues
search
TysonAndre
/
pecl-teds
Tentative Extra Data Structures for php
BSD 3-Clause "New" or "Revised" License
30
stars
4
forks
source link
Idea: `final class Teds\ComparableObject {public readonly $key: mixed; public $value; }`
#201
Open
TysonAndre
opened
2 years ago
TysonAndre
commented
2 years ago
This could throw for keys that don't have a stable comparison order, e.g. most objects
stable_compare could check for instances of this class
This could be used in StableMinHeap, stable sorts, etc.
This class would override the regular object comparison handler to compare $key if the instances were the same to be usable in
<=>
,
<
, sort, etc.
<=>
,<
, sort, etc.