title: Undefined index errors when using plus equal operator
body: <p>I'm working on another developers old code and there are tons of Notice: Undefined index errors when data is being set using the += operator. Essentially the index is not set yet in the array so the error is generated.</p>
  
  <p>Example:</p>
  
  <pre><code>$myArray = array();
  $myValue = 1;
  for ($i = 1; $i &lt;= 10; $i++) 
  {
      $myArray['test'] += 1;
  }
  </code></pre>
  
  <p>Will generate an error on the first run since the test index is not set yet.</p>
  
  <p>I know I can remove this error with the following code:</p>
  
  <pre><code>$myArray = array();
  $myValue = 1;
  for ($i = 1; $i &lt;= 10; $i++) 
  {
      if ( ! isset($myArray['test']) )
      {
          $myArray['test'] = $myValue;
      } 
      else 
      {
          $myArray['test'] += $myValue;
      }
  }
  </code></pre>
  
  <p>However, there are around 50 of things like this to change. Is it worth writing all these isset statements or is there a better way I am not aware of? </p>
  
  <p>EDIT: I should note that the array indexes aren't always the same and sometimes aren't set so I can't preset the index in this circumstance to avoid the error.</p>