title: Dealing with an array that may or may not contain a specific offset
body: <p>I have this function below:</p>
  
  <pre><code>public function set_partial($array)
  {
      if (is_array($array)) {
          foreach ($array as $each) {
              self::$_partials[$each[0]] = array('view' =&gt; $each[1], 'data' =&gt; $each[2]);
          }
      }
  }
  </code></pre>
  
  <p>In self::$_partials, 'data' isn't required. So how do I keep my code simple while allowing data to be null? Right now, if data isn't provided, then I get an offset error.</p>