title: PHP is accessing nested arrays copying them?
body: <p>Let's say I have an array (it really could have any depth):</p>
  
  <pre><code>$arr = array(
    "lvl1" =&gt; array(
      "lvl2 =&gt; ...
    )
  )
  </code></pre>
  
  <p>Now in a function I need to access it like this:</p>
  
  <pre><code>$path = array("lvl1", "lvl2", ...); // array of ordered indexes
  $tmp = $arr;
  foreach($path as $lvl){
    ...// other read-only/copy stuff happening on the array, no editing
    $tmp = $tmp[$lvl];
  }
  </code></pre>
  
  <p>At this point, just out of curiosity (no real optimization here), am I making <em>copies of copies</em> everytime? Or is it just using references automatically?</p>