PHP | Ds\Map capacity() Function Last Updated : 20 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Ds\Map::capacity() function is an inbuilt function in PHP, which is used to return the current capacity of the map. Syntax: int public Ds\Map::capacity( void ) Parameter: This function does not accept any parameter. Return value: This function returns the current capacity of map. Below program illustrates the Ds\Map::capacity() function in PHP: Program: php <?php // Declare a map $map = new \Ds\Map(); // Use capacity() function var_dump($map->capacity()); // Creating a Map $map = new \Ds\Map(["1" => "Geeks", "2" => "for", "3" => "Geeks"]); // Use capacity() function var_dump($map->capacity()); ?> Output: int(8) int(8) Reference: https://www.php.net/manual/en/ds-map.capacity.php Comment More infoAdvertise with us Next Article PHP | Ds\Map capacity() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_map Similar Reads PHP | DsSet capacity() Function The Ds\Set::capacity() function is an inbuilt function in PHP which is used to return the capacity of the set. Syntax: int public Ds\Set::capacity( void ) Parameter: This function does not accepts any parameter. Return value: This function returns the current capacity of set. Below programs illustra 1 min read PHP | DsDeque capacity() Function The Ds\Deque::capacity() function is an inbuilt function in PHP which is used to get the current capacity of the Deque. Syntax: public Ds\Deque::capacity( void ) : int Parameters: This function does not accepts any parameter. Return Value: This function returns the current capacity of the Deque. Bel 1 min read PHP | DsStack capacity() Function The Ds\Stack::capacity() function is an inbuilt function in PHP which is used to return the current capacity of the stack. Syntax: int Ds\Stack::capacity( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the current capacity of the stack. Below pro 1 min read PHP DsQueue capacity() Function The Ds\Queue::capacity() Function in PHP is used to check the current capacity of a Queue instance. Syntax: int public Ds\Queue::capacity ( void ) Parameters: This function does not accepts any parameters. Return Value: This function returns the current capacity of the Queue instance. Below programs 1 min read PHP | DsVector capacity() Function The Ds\Vector::capacity() function is an inbuilt function in PHP which is used to return the current capacity of the vector. Syntax: int public Ds\Vector::capacity( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the current capacity of vector. Bel 1 min read Like