Is there any alternative to operator[] for arrays in php?
function getArray() {
return array(1, 2, 3);
}
$e = getArray()[1];
In my php version this doesn't work. Any suggestons of graceful syntax?
At the moment the two-line solution seems to be the only possibility:
$arr = getArray();
$e = arr[1];
Thanks