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
  • 47,132
  • 31
  • 107
  • 135

0 Answers0