php most elegant function call returning array
This question is not simply preference, the second method is better than the first for the following reasons:

In the first, you initialise a function test and it returns an array: test[]
So, alongside the string to test against 'short' in the memory, you now have those three things in the memory.

Whereas, in the second example, you don't return an array, and the 'short' string is only used as a parameter, by doing this you now can only have two things in the memory.

Therefore, the second code block is better than the first.

Also, in the spirit of Code Review, you can further improve the second code block, by not actually assigning $array, or using a switch.

public function test($myVar, $key) {
    return [
        'test1' =&gt; [
            'value' =&gt; 'Value of test1',
            'short' =&gt; 'Val 1'
        ]
    ][$myVar][$key];
}

$this-&gt;test('test1', 'short')  // Val 1



$myvar should also be in camelCase: $myVar