Variable variables are considered unused when only appearing on the left-hand side of an assignment.
This is considered fine:
function fn()
{
$foo = true;
$var = 'foo';
return $$var;
}
While this says $var is unused:
function fn()
{
$foo = true;
$var = 'foo';
$$var = false;
}
($foo is marked unused in both cases, but I guess there's no way to avoid that without deeper program flow analysis.)