Background
In every other programming language I use on a regular basis, it is simple to operate on the return value of a function without declaring
You can't chain expressions like that in PHP, so you'll have to save the result of array_test() in a variable.
array_test()
Try this:
function array_test() { return array(0, 1, 2); } $array = array_test(); echo $array[0];