HH\Map::isEmpty

Description

public function isEmpty(): bool

Checks if the current Map is empty.

Return Values

  • bool - true if the current Map is empty; false otherwise.

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Map\IsEmpty;

$m = Map {};
var_dump($m->isEmpty());

$m = Map {
  'red' => '#ff0000',
  'green' => '#00ff00',
  'blue' => '#0000ff',
  'yellow' => '#ffff00',
  'purple' => '#663399',
};
var_dump($m->isEmpty());
Output
bool(true)
bool(false)