Question: any idea how if the following is possible in PHP as a single line ?:

```
<?php
$firstElement = functionThatReturnsAnArray()[0];

```

... It doesn't seem to 'take'. I need to do this as a 2-stepper:

```
<?php
$allElements = functionThatReturnsAnArray();
$firstElement = $allElements[0];

```

... just curious - other languages I play with allow things like this, and I'm lazy enoug to miss this in PHP ... any insight appreciated ...

Answer: 
Either `current($array)` or `array_shift($array)` will work, the former will leave the *array* intact.
<http://us3.php.net/reset>

Only available in php version 5.