title: Create an array from the keys of an array
body: <p>Let's pretend I have this:</p>
  
  <pre><code>$str = "/a/b/c/d/";
  $arr = array_filter( explode("/", $str );
  </code></pre>
  
  <p>At this point <code>$arr</code> contains 4 elements. Is there a way I could create a path in an array with those 4 elements, such as:</p>
  
  <pre><code>$result = [
      "a" =&gt; [
          "b" =&gt; [
              "c" =&gt; [
                  "d" =&gt; [
  
                  ]
              ]
          ]
      ]
  ]
  </code></pre>
  
  <p>...without iterating over <code>$arr</code>?</p>
  
  <p>I know that </p>
  
  <pre><code>$x["a"]["b"]["c"]["d"] = 1;
  </code></pre>
  
  <p>is perfectly valid and it will create a 4 levels array even if <code>$x</code> wasn't declared as an array, so what I'm asking should be possible.</p>