Is your feature request related to a problem?
Seems like a quick win - the FunctionDeclarations::getProperties() method already does quite some token walking in the function signature anyway, so why not also keep track of whether a function is declared to return by reference ?
Describe the solution you'd like
The (bool) return_by_reference index to be added to the array returned by the FunctionDeclarations::getProperties() method.
By default, the value should be false, though for the below three examples, the value should be true.
function &byref( $param) {}
$cl = function &( $param) {};
$arrow = fn &( $param) => null;