r/PHPhelp • • Jul 26 '11

array question

New to php

function ReturnsArrayNotEmpty()...

Why can't I reference elements in the array like the following:

$value = $this->ReturnsArrayNotEmpty()[0];

?

Whereas, this works fine,

$value = $this->ReturnsArrayNotEmpty(); $another = $value[0];

8 Upvotes

3 comments sorted by