Determines whether the map contains a given key
$key
Determines whether the map contains a given key.
key
The key to look for.
Returns true if the key could found, false otherwise.
true
false
例1 Ds\Map::hasKey example
<?php$map = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);var_dump($map->hasKey("a")); // truevar_dump($map->hasKey("e")); // false?>
上の例の出力は、 たとえば以下のようになります。
bool(true) bool(false)