2

Is there any way to do this in one line?

$arr = $foo->getBarArray();
return $arr[0];

This throws an error:

return $foo->getBarArray()[0];
James Skidmore
  • 49,340
  • 32
  • 108
  • 136

0 Answers0