« Ds\Map::hasKey
Ds\Map::intersect »

Ds\Map::hasValue

(PECL ds >= 1.0.0)

Ds\Map::hasValue — Determines whether the map contains a given value

説明

public function Ds\Map::hasValue(mixed $value): bool

Determines whether the map contains a given value.

パラメータ

value

The value to look for.

戻り値

Returns true if the value could be found, false otherwise.

例

例1 Ds\Map::hasValue() example

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

var_dump($map->hasValue(1)); // true
var_dump($map->hasValue(4)); // false
?>

上の例の出力は、 たとえば以下のようになります。

bool(true)
bool(false)
関連キーワード:
hasValue   Determines   whether   contains   given   dump   hasKey   intersect   mixed   look   found   otherwise   example
関連する関数・ページ:
ds-map.haskey   ds-set.contains   ds-vector.contains   ds-sequence.contains   ds-deque.contains   book.ds