Search Results
SplPriorityQueue::current (PHP 5 >= 5.3.0, PHP 7, PHP 8) SplPriorityQueue::current — Return current node pointed by the iterator
SplPriorityQueue::compare — Compare priorities in order to place elements correctly in the heap while sifting up SplPriorityQueue::count — Counts the number of elements in the queue SplPriorityQueue::current — Return current node pointed by the iterator SplPriorityQueue::extract — Extracts a node from top of the heap and sift up
In the priorityQueue->insert(value, priority) method of the SplPriorityQueue class, the second parameter, priority, specifies the priority of the element being inserted. The queue uses this priority to order its elements, ensuring that elements with higher priority values will be extracted before those with lower priority values.
Apr 22, 2021 · The SplPriorityQueue::current () function is an inbuilt function in PHP which is used to return the current node pointed by the iterator. Syntax: mixed SplPriorityQueue::current() Parameters: This function does not accept any parameter. Return Value: This function returns the value/priority of the current node depending on the extract flag. Example:
SplPriorityQueue::current (PHP 5 >= 5.3.0, PHP 7, PHP 8) SplPriorityQueue::current — Return current node pointed by the iterator
Return Values The value or priority (or both) of the current node, depending on the extract flag.
PHP Manual Return Values The value or priority (or both) of the current node, depending on the extract flag.
