array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'ds-queue.capacity.php', 1 => 'Ds\\Queue::capacity', 2 => 'Returns the current capacity', ), 'up' => array ( 0 => 'class.ds-queue.php', 1 => 'Ds\\Queue', ), 'prev' => array ( 0 => 'ds-queue.allocate.php', 1 => 'Ds\\Queue::allocate', ), 'next' => array ( 0 => 'ds-queue.clear.php', 1 => 'Ds\\Queue::clear', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/queue/capacity.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Ds\Queue::capacity

(PECL ds >= 1.0.0)

Ds\Queue::capacityReturns the current capacity

Beschreibung

public Ds\Queue::capacity(): int

Returns the current capacity.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

The current capacity.

Beispiele

Beispiel #1 Ds\Queue::capacity() example

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

$queue->push(...range(1, 50));
var_dump($queue->capacity());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

int(8)
int(64)