编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « pht\Queue::push
  • pht\Queue::unlock »
  • PHP Manual
  • pht\Queue
  • Gets the size of the queue

pht\Queue::size

(PECL pht >= 0.0.1)

pht\Queue::size — Gets the size of the queue

说明

public pht\Queue::size ( void ) : int

Returns the current size of the queue. This operation requires a pht\Queue's mutex lock to be held if it is being used by multiple threads.

参数

此函数没有参数。

返回值

The size of the queue.

范例

Example #1 Getting a queue's size

<?php

use pht\Queue;

$queue = new Queue();

$queue->push(1);
$queue->push(1);

var_dump($queue->size());

以上例程会输出:

int(2)

相关文章
php pht the queue classphp ffi gets the size of c data or typesphp ibm db2 函数 gets a user defined size of lob files with each invocationphp mhash 函数 gets the block size of the specified hashphp imagick gets the gravityphp imagick gets channel rangephp imagick gets the image gammaphp imagick gets point sizephp pht atomicinteger gets the atomic integer s valuephp pht hashtable gets the size of the hash tablephp pht queue returns the first value from a queuephp pht queue acquires the queue s mutex lockphp pht queue pops a value off of the front of a queuephp pht queue pushes a value to the end of a queuephp pht queue gets the size of the queuephp pht queue releases the queue s mutex lockphp pht thread gets a thread s task countphp pht vector gets the size of the vectorphp splfileinfo gets file sizephp splfixedarray gets the size of the array
关注编程学问公众号
编程学问网 湘ICP备20001732号