Why can't I do this?
Because PHP doesn't currently support this syntax. But you can pass it to a function, e.g.:
current(explode(',','1,2,3', 1));
Otherwise, you have to assign the return value to a variable first, then access via index.
More Info:
So one can chain method calls or
property access. Now for a long time
people requested the same thing for
array offset access. This was often
rejected due to uncertainties about
memory issues, as we don't like
memory leaks. But after proper
evaluation Felipe committed the patch
which allows you to do things like:
function foo() {
return array(1, 2, 3);
}
echo foo()[2]; // prints 3
http://schlueters.de/blog/archives/138-Features-in-PHP-trunk-Array-dereferencing.html
So, it is in the development pipeline but, as I stated, is not currently supported.
Update
PHP >= 5.4 now supports function array dereferencing, e.g. foo()[0]