Suppose i have function
array get_array($argument)
I want access to single element of this array in, so, python style like this:
$vector = get_array($argument)[2];
There is an elegant way to do this without new variables, rewriting function and so on?
Sure, use PHP 5.4, which supports function array dereferencing
Function array dereferencing has been added, e.g. foo()[0].