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: 
I actually use a convenience function i wrote for such purposes:

```
/**
 * Grabs an element from an array using a key much like array_pop
 */
function array_key_value($array, $key) {
    if(!empty($array) && array_key_exists($key, $array)) {
        return $array[$key];
    }
    else {
        return FALSE;
    }
}

```

then you just call it like so:

```
$result = array_key_value(getMeAnArray(), 'arrayKey');

```
nickf, good to know, thanks. Unfortunately that has readability problems beyond a few commas.