title: How can I check if an array element exists?
body: <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>
  <blockquote>
  <p>Notice: Undefined index: test in /Applications/MAMP/htdocs/mysite/MyClass.php on line 16</p>
  </blockquote>
  <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>