php8.5
Home/ Manual/ ds / map/ Ds\Map::isEmpty

Ds\Map::isEmpty

PHP function Edit on GitHub ✎

(PECL ds >= 1.0.0)

Returns whether the map is empty

Description

Ds\Map::isEmpty(): bool

Returns whether the map is empty.

Parameters Parameters

Return Values

Returns true if the map is empty, false otherwise.

Examples

Ds\Map::isEmpty() example

php
<?php
$a = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);
$b = new \Ds\Map();

var_dump($a->isEmpty());
var_dump($b->isEmpty());
?>

The above example will output something similar to:

output
bool(false)
bool(true)

Source: reference/ds/ds/map/isempty.xml · from the official PHP manual (php/doc-en)