略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SplPriorityQueue::count

2024-12-22

SplPriorityQueue::count

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

SplPriorityQueue::countCounts the number of elements in the queue

说明

public SplPriorityQueue::count(): int

参数

此函数没有参数。

返回值

Returns the number of elements in the queue.

add a noteadd a note

User Contributed Notes 1 note

up
1
xedin dot unknown at gmail dot com
3 years 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

官方地址:https://www.php.net/manual/en/splpriorityqueue.count.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3