Hi. I think this is a bug?
$foo = false;
$myFunc = function(&$bar) { $bar = true; };
$myFunc($foo);
if($foo)
{
echo "I'm true!"; // Flagged as 'Unreachable code detected' since it doesn't understand $foo has changed when passed by reference to anon function
}
PHP 8.1. Latest VS Code. Happens with latest (1.45 premium) but last few versions too.