The Ds\Set::allocate() function is an inbuilt function in PHP which is used to allocate memory for required capacity.
void public Ds\Set::allocate( $capacity )
Parameters: This function accepts single parameter $capacity which holds the value of capacity to be allocated. Capacity always rounded in powers of 2.
Return value: This function does not return any values.
Below programs illustrate the Ds\Set::allocate() function in PHP:
Allocated Space is: int(8) Allocated space is: int(64)
Allocated Space is: int(8) Allocated space is: int(8) Allocated space is: int(128)