I was led to believe that it was possible to access an array returned
from a function in php5 without first assigning it to a variable as
follows ;-
....
function setArr()
{
return array( 1, 2, 3, 4, 5 ) ;
}
echo setArr()[ 3 ] ;
However this does not work - it just produces a parse error.
Have I been mis-informed or am I doing it wrong ?
TIA
from a function in php5 without first assigning it to a variable as
follows ;-
....
function setArr()
{
return array( 1, 2, 3, 4, 5 ) ;
}
echo setArr()[ 3 ] ;
However this does not work - it just produces a parse error.
Have I been mis-informed or am I doing it wrong ?
TIA
Comment