• PHP Video Tutorials

PHP - Ds Set allocate() Function



Ds\Set::allocate() function can allocate enough memory for the required capacity.

Syntax

public void Ds\Set::allocate( int $capacity )

Ds\Set::allocate() function doesn't return any value.

Example

<?php  
   $set = new \Ds\Set(); 
   echo("The allocated space:"); 
   var_dump($set->capacity());   
  
   $set->allocate(20);  
   echo("The allocated space:"); 
   var_dump($set->capacity());  
  
   echo("The allocated space:"); 
   $set->allocate(70);  
   var_dump($set->capacity());  
?> 
php_function_reference.htm
Advertisements