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 // 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()); ?> |
chevron_right
filter_none
Output:
int(8) int(8)
Reference: https://www.php.net/manual/en/ds-map.capacity.php
Recommended Posts:
- PHP | Ds\Set capacity() Function
- PHP | Ds\Deque capacity() Function
- PHP | Ds\Vector capacity() Function
- PHP Ds\PriorityQueue capacity() Function
- PHP Ds\Queue capacity() Function
- PHP | Ds\Sequence capacity() Function
- PHP | Ds\Stack capacity() Function
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- PHP | imagecreatetruecolor() Function
- PHP | fpassthru( ) Function
- PHP | ImagickDraw getTextAlignment() Function
- PHP | Ds\Sequence last() Function
- PHP | Imagick floodFillPaintImage() Function
- Function to escape regex patterns before applied in PHP
- PHP | array_udiff_uassoc() Function
- PHP | geoip_continent_code_by_name() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

