php8.5
Home/ Manual/ spl / splpriorityqueue/ SplPriorityQueue::setExtractFlags

SplPriorityQueue::setExtractFlags

PHP function Edit on GitHub ✎

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

Sets the mode of extraction

Description

SplPriorityQueue::setExtractFlags(int $flags): int

Parameters

flags

Defines what is extracted by SplPriorityQueue::current, SplPriorityQueue::top and SplPriorityQueue::extract.

  • SplPriorityQueue::EXTR_DATA (0x00000001): Extract the data
  • SplPriorityQueue::EXTR_PRIORITY (0x00000002): Extract the priority
  • SplPriorityQueue::EXTR_BOTH (0x00000003): Extract an array containing both

The default mode is SplPriorityQueue::EXTR_DATA.

Return Values

Returns the flags of extraction.

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