Ds\Queue::capacity() 函數可以返回當前容量。
用法
public int Ds\Queue::capacity( void )
Ds\Queue::capacity() 函數沒有任何參數。
示例1
<?php
$queue = new \Ds\Queue();
var_dump($queue->capacity());
?>
示例2
<?php
$queue = new \Ds\Queue();
echo("The current capacity is:");
var_dump($queue->capacity());
echo("The current capacity is:");
$queue->allocate(20);
var_dump($queue->capacity());
$queue->allocate(100);
var_dump($queue->capacity());
?>
相關用法
- PHP Ds\Queue::push()用法及代碼示例
- PHP Ds\Queue::pop()用法及代碼示例
- PHP Ds\Queue::peek()用法及代碼示例
- PHP Ds\Queue::allocate()用法及代碼示例
- PHP Ds\Queue pop()用法及代碼示例
- PHP Ds\Queue push()用法及代碼示例
- PHP Ds\Queue clear()用法及代碼示例
- PHP Ds\Queue capacity()用法及代碼示例
- PHP Ds\Queue count()用法及代碼示例
- PHP Ds\Queue copy()用法及代碼示例
- PHP Ds\Queue isEmpty()用法及代碼示例
- PHP Ds\Queue allocate()用法及代碼示例
- PHP Ds\Queue toArray()用法及代碼示例
- PHP Ds\Queue peek()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP - Ds\Queue::capacity() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。