title: Twig - array_pop?
body: <p>I have a multi dimensional array along the lines of</p>
  
  <pre><code>array(2) { 
      [11]=&gt; array(1) { 
          ["L2J"]=&gt; array(1) { 
              ["VS7"]=&gt; array(2) { 
                  ["26 Feb 2015 12:00"]=&gt; array(2) { 
                      ["C"]=&gt; string(1) "9" 
                      ["D"]=&gt; string(1) "9" 
                  } 
                  ["26 Feb 2015 13:00"]=&gt; array(2) { 
                      ["C"]=&gt; string(1) "9" 
                      ["D"]=&gt; string(1) "6" 
                  } 
              } 
          } 
      } 
  }
  </code></pre>
  
  <p>Now I have done some looping and I am now at the point where I have access to the dates.</p>
  
  <pre><code>{% for sid, psuedos in alerts %}
      {% for psuedo, flights in psuedos %}
          {% for flight, dates in flights %}
  
          {% endfor %}
      {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>Now I am converting some normal PHP code and at this point, I would do</p>
  
  <pre><code>$firstDate = array_pop(array_keys($dates));
  </code></pre>
  
  <p>Is there any way to do something like this in Twig?  I have searched about but cant seem to find anything.</p>
  
  <p><strong>Update</strong></p>
  
  <p>This is my latest effort, can't seem to get it to slice the last array element though</p>
  
  <pre><code>{% set firstDate = [dates|keys]|last|slice(1) %}
  </code></pre>