Syntax:int public DsMap::capacity (void)
Parameter: this function takes no parameters.Returned value:this function returns the current capacity of the map.The program below illustrates the Ds / Map function: : acity()in PHP:Program :
// Declare the map
$map
=
new
DsMap ( );
// Using the Capacity() function
var_dump (
$map
-> capacity());
// Create a map
$map
=
new
DsMap ([
"1"
= >
"Geeks"
,
"2"
= >
"for"
,
"3"
= >
"Geeks"
]);
// Using the Capacity() function
var_dump (
$map
-> capacity());
?>
Exit:int (8 ) int (8)
Link: https: / /www.php.net/manual/en/ds-map.capacity.php