How to check if an array element exists?
<p>Example: I'm checking for the existence of an array element like this:</p>

<pre><code>if (!self::$instances[$instanceKey]) {
    $instances[$instanceKey] = $theInstance;
}
</code></pre>

<p>However, I keep getting this error:</p>

<pre><code>Notice: Undefined index: test in /Applications/MAMP/htdocs/mysite/MyClass.php on line 16
</code></pre>

<p>Of course, the first time I want an instance, $instances will not know the key. I guess my check for available instance is wrong?</p>
