Logo

Programming-Idioms

History of Idiom 170 > diff from v9 to v10

Edit summary for version 10 by programming-idioms.org:
[PHP] Comments emphasis

Version 9

2018-08-23, 17:43:58

Version 10

2018-09-06, 19:55:45

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);
Code
$n = count($mymap);
Comments bubble
$mymap is an array, arrays in PHP are ordered maps
Comments bubble
$mymap is an array, arrays in PHP are ordered maps
Doc URL
https://secure.php.net/manual/en/function.count.php
Doc URL
https://secure.php.net/manual/en/function.count.php
Demo URL
https://3v4l.org/jk3DD
Demo URL
https://3v4l.org/jk3DD