The Ds\Map::allocate() function is an inbuilt function in PHP which is used to allocate enough memory for required capacity.
void public Ds\Map::allocate( $capacity )
Parameters: This function accepts single parameter $capacity which indicate number of capacity allocated.
Return Value: This function does not return any values.
Below programs illustrate the Ds\Map::allocate() function in PHP:
int(8) int(64) int(128)
int(16) int(32) int(32) int(64)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.