<pre><code>function returnsAnArray ()
{
  return array ('test');
}

echo returnsAnArray ()[0];
</code></pre>

<p>generates a syntax error in PHP. What's the most efficient way to directly obtain an element from a returned array without assigning the result to a temp variable?</p>

This will work if there is only one member in the array:
```
```
<?php
 echo current(returnsAnArray());
 ?>
```
```