Logo

Programming-Idioms

History of Idiom 170 > diff from v8 to v9

Edit summary for version 9 by ricardo_sdl:
New PHP implementation by user [ricardo_sdl]

Version 8

2018-08-06, 15:40:47

Version 9

2018-08-23, 17:43:58

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

Extra Keywords
length count
Extra Keywords
length count
Code
$n = count($mymap);
Comments bubble
$mymap is an array, arrays in PHP are ordered maps
Doc URL
https://secure.php.net/manual/en/function.count.php
Demo URL
https://3v4l.org/jk3DD