title: Php, isset - default value, can it be simplified?
body: <p>here is something:</p>
  
  <pre><code>$result = $this-&gt;getSomething();
  
  $db = new Db();
  $db-&gt;save($result['DATA']); // might exists or not
  $db-&gt;save($result['IP']); // might exists or not
  $db-&gt;save($result['X']); // might exists or not
  </code></pre>
  
  <p>but those array keys are not sure to be exists. Of corse I can always write this:</p>
  
  <pre><code>$result = $this-&gt;getSomething();
  
  if (!isset($result['DATA']))
  {
      $result['DATA'] = null;
  }
  //same for the other keys
  
  $db = new Db();
  $db-&gt;save($result['DATA']);
  $db-&gt;save($result['IP']);
  $db-&gt;save($result['X']);
  </code></pre>
  
  <p>but its very cumbersome job. Is there any way to simplify this?</p>