Question: In Exception Safety as created by Abrahams we have the three guarantees: basic, strong and no-throw guarantee. 
Can i say that if i have a codebase using nothrow for "new" and noexcept for method signatures that i have the no-throw guarantee? 

Thanks.

Answer: 
Looking down the list of [Array Functions](http://php.net/manual/en/ref.array.php) in the docs, I don't see anything built-in to do this. But it's easy to roll your own utility function for it:

```
/*
    Returns true if the $key exists in the haystack and its value is $value.

    Otherwise, returns false.
*/
function key_value_pair_exists(array $haystack, $key, $value) {
    return array_key_exists($key, $haystack) &&
           $haystack[$key] == $value;
}

```

Example usage:

```
$countries_to_capitals = [
    'Switzerland' => 'Bern',
    'Nepal' => 'Kathmandu',
    'Canada' => 'Ottawa',
    'Australia' => 'Canberra',
    'Egypt' => 'Cairo',
    'Mexico' => 'Mexico City'
];
var_dump(
    key_value_pair_exists($countries_to_capitals, 'Canada', 'Ottawa')
); // true
var_dump(
    key_value_pair_exists($countries_to_capitals, 'Switzerland', 'Geneva')
); // false

```
```
if (isset($elements[$country]) AND $elements[$country] == $capitale) {
    return true;
}
return false;

```