php access array value from function return

arrays, php, scope

Solution

The syntax just doesn't allow it unfortunately.

AFAIK there was at one time intention to put that syntax in PHP6, but it has been dropped.

Problem

silly php question... why cant i do this? ``` echo Auth::getFullUser()[ 'country' ]; ``` instead you have to do this ``` $user = Auth::getFullUser(); echo $user[ 'country' ]; ```

Original source