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: 
Well, I have found a couple of ways to get what you want without calling another function.

```
$firstElement = ($t = functionThatReturnsAnArray()) ? $t[0] : false;

```

and for strings you could use 

```
$string = (($t = functionThatReturnsAnArray())==0) . $t[0];

```

.. Interesting problem

Draco
Sometimes I'll change the function, so it can optionally return an element instead of the entire array:

```
<?php
function functionThatReturnsAnArray($n = NULL) {
  return ($n === NULL ? $myArray : $myArray[$n]);
}
$firstElement = functionThatReturnsAnArray(0);

```