You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the default configuration (phpcs --standard=VariableAnalysis -s phpcs-test.php), this is detected as "Unused variable $unused_variable (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable)". ✅
Snippet 2:
<?php$unused_variable = 'foo';
?>
The addition of the ?> stops the violation from being reported, even though the variable is still unused. ❌