Here's a simple example that generates UndefinedVariable for using the Arrow Functions and compact method.
$something = fn ($arg) => compact('arg'); // Unused function parameter $arg. (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable) I am using v2.11.19.
Thank you.