SplPriorityQueue::count

(PHP 5 >= 5.3.0, PHP 7)

SplPriorityQueue::countCounts the number of elements in the queue.

설명

public int SplPriorityQueue::count ( void )

인수

이 함수는 인수가 없습니다.

반환값

Returns the number of elements in the queue.

add a note add a note

User Contributed Notes 1 note

up
0
xedin dot unknown at gmail dot com
1 year ago
After iteration, the queue will be empty. Therefore, `count()` will return 0. You can circumvent this by iterating over a clone, instead of the actual queue.

https://stackoverflow.com/questions/27464012/splpriorityqueuenext-is-removing-the-item
To Top