Logo

Programming-Idioms

  • PHP
  • Dart

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

var n = mymap.length;
$n = count($mymap);

$mymap is an array, arrays in PHP are ordered maps
(def n (count mymap))

New implementation...
< >
programming-idioms.org