(PHP 5 >= 5.3.0, PHP 7, PHP 8)
The SplPriorityQueue class provides the main functionalities of a prioritized queue, implemented using a max heap.
Note: The order of elements with identical priority is undefined. It may differ from the order in which they have been inserted.
SplPriorityQueue::EXTR_BOTH
SplPriorityQueue::EXTR_PRIORITY
SplPriorityQueue::EXTR_DATA