title: Is there a shorthand for conditional assigning in PHP
body: <p>I have the following (simplified) code-fragment where I want to assign a value to variable $shell or $hole, depending on a certain condition ($ringIndex===1)</p>
  
  <pre><code>foreach($rings as $ringIndex=&gt;$ring) {
      $polygon = $this-&gt;getPolygonFromRing($ring);
      if($ringIndex===1) {
          $shell = $polygon;
      } else {
          $hole = $polygon;
      }
      .... 
  }
  </code></pre>
  
  <p>I don't want to use an extra variable ($polygon) if it is not necessary</p>
  
  <p>I thought maybe something like this would work: </p>
  
  <pre><code>foreach($rings as $ringIndex=&gt;$ring) {
      ($ringIndex===1?$shell:$hole) = $this&gt;getPolygonFromRing($ring);
      ...
  }
  </code></pre>