title: Is there a significant delay in looking up a multi-dimensional array's value(s) in PHP?
body: <p>Which of the following is the more optimal approach? Option A or B?</p>
  
  <p>Option A: looking up the multi-dimensional array's value twice</p>
  
  <pre><code>if($my_array["dimension1"]["dimension2"]["dimension3"] &gt; 0 ) {
      echo $my_array["dimension1"]["dimension2"]["dimension3"];
  }
  </code></pre>
  
  <p>Option B: looking up the multi-dimensional array's value once, but with an extra variable defintion</p>
  
  <pre><code>$dimension3 = $my_array["dimension1"]["dimension2"]["dimension3"];
  if($dimension3 &gt; 0) {
      echo $dimension3;
  }
  </code></pre>
  
  <p>Personally I find option B more readable, but this code is being executed a couple hundred thousand times, so the more optimal approach would take preference.</p>