标签: php arrays
可能重复: PHP syntax for dereferencing function result
使用下面的$tmp非常难看。有没有办法避免它?
$tmp
function test() { return array('a'=>1, 'b'=>2); } $tmp = test(); echo "This should be 2: ", $tmp['b'], "\n";
是否有某种原因是自然的
test()['b']
不起作用?