Returns the current capacity

Ds\Queue::capacity

(PECL ds >= 1.0.0)

Ds\Queue::capacityReturns the current capacity

說明

public Ds\Queue::capacity(): int

Returns the current capacity.

參數

此函式沒有參數。

返回值

The current capacity.

範例

示例 #1 Ds\Queue::capacity() example

<?php
$queue 
= new \Ds\Queue();
var_dump($queue->capacity());

$queue->push(...range(150));
var_dump($queue->capacity());
?>

以上例程的輸出類似於:

int(8)
int(64)

Leave a Reply

Your email address will not be published. Required fields are marked *