Ds\Map::hasKey

(PECL ds >= 1.0.0)

Ds\Map::hasKeyDetermines whether the map contains a given key

说锟斤拷

public Ds\Map::hasKey ( mixed $key ) : bool

Determines whether the map contains a given key.

锟斤拷锟斤拷

key

The key to look for.

锟斤拷锟斤拷值

Returns TRUE if the key could found, FALSE otherwise.

锟斤拷锟斤拷

Example #1 Ds\Map::hasKey() example

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

var_dump($map->hasKey("a")); // true
var_dump($map->hasKey("e")); // false
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

bool(true)
bool(false)