Interpreting return value of function directly as an array
<p>Is there a way in PHP to interpret the return value of a function directly as an array?</p>

<p>lets say i have a function:</p>

<pre><code>function getArray()  {
  return array("foo", "bar");
}
</code></pre>

<p>instead of writing:</p>

<pre><code>$array = getArray();
$var = $array[1];
</code></pre>

<p>i want to access "bar" directly somewhat like:</p>

<pre><code>$var = getArray()[1]; //this causes an error
</code></pre>
