php8.5
Home/ Manual/ reference / spl/ The SplPriorityQueue class

The SplPriorityQueue class

The SplPriorityQueue class provides the main functionalities of a prioritized queue, implemented using a max heap.

Intro

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.

Class synopsis

class SplPriorityQueue implements Iterator implements Countable { }

Predefined Constants

SplPriorityQueue::EXTR_BOTH
SplPriorityQueue::EXTR_PRIORITY
SplPriorityQueue::EXTR_DATA

Changelog

VersionDescription

Splpriorityqueue

In this section

Source: reference/spl/splpriorityqueue.xml · from the official PHP manual (php/doc-en)