r/PHPhelp • u/ryancwarren • 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
1
u/[deleted] Jul 26 '11
It's not allowed syntactically, but I agree this should be a feature.