PHP - Funzione Ds \ Queue :: capacity ()

La funzione Ds \ Queue :: capacity () può restituire la capacità corrente.

Sintassi

public int Ds\Queue::capacity( void )

La funzione Ds \ Queue :: capacity () non ha parametri.

Esempio 1

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

Esempio-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());  
?>