What's quicker and better to determine if an array key exists in PHP?
<p>Consider these 2 examples</p>

<pre><code>$key = 'jim';

// example 1
    if (isset($array[$key])) {
       doWhatIWant();
    }

// example 2    
    if (array_key_exists($key, $array)) {
       doWhatIWant();
    }
</code></pre>

<p>I'm interested in knowing if either of these are better. I've always used the first, but have seen a lot of people use the second example on this site.</p>

<p>So, which is better? Faster? Clearer intent?</p>

<h2>Update</h2>

<p>Thanks for the quality answers. I now understand the difference between the 2. A benchmark states that <a href="http://codepad.org/RcdAewVF"><code>isset()</code> alone is quicker than <code>array_key_exists()</code></a>. However, if you want the <code>isset()</code> to behave like <code>array_key_exists()</code> <a href="http://codepad.org/5qyvS93x">it is slower</a>.</p>
