title: Is it possible to reference a specific element of an anonymous array in PHP?
body: <p>This is probably a simple question, and I'm afraid the answer might be "no", but...</p>
  
  <p>Here's a simple piece of code:</p>
  
  <pre><code>function func1() {
    $bt = debug_backtrace();
    print "Previous function was " . $bt[1]['function'] . "\n";
  }
  </code></pre>
  
  <p>Now...  Can this be done without the temporary variable?  In another language, I might expect to be able to say:</p>
  
  <pre><code>function func1() {
    print "Previous function was " . (debug_backtrace())[1]['function'] . "\n";
  }
  </code></pre>
  
  <p>Alas, in PHP, this results in an error:</p>
  
  <pre><code>PHP Parse error:  syntax error, unexpected '[' ...
  </code></pre>
  
  <p>If it can't be done, it can't be done, and I'll use a temporary variable, but I'd rather not.</p>