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

SplPriorityQueue::insert

PHP function Edit on GitHub ✎

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

Inserts an element in the queue by sifting it up

Description

SplPriorityQueue::insert(mixed $value, mixed $priority): true

Insert value with the priority priority in the queue.

Parameters

value

The value to insert.

priority

The associated priority.

Return Values

Always

Changelog

VersionDescription
8.4.0SplPriorityQueue::insert now has a tentative return of true.

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