It would be nice if Check Syntax can see if there are any unused variables. I have implemented it already (albeit not in PHP) and it does catch mistakes in existing filters:
- Report at ptwiki
- Report at arwiki and it's subsequently fixed
- Report at fiwiki and it's subsequently fixed.
There are of course some correctly functional filters that do have unused variables, like https://en.wikipedia.org/wiki/Special:AbuseFilter/828. While I will argue that these are nonetheless mistakes, it might be worth implementing a warning mode for Check Syntax (which allows filters to be saved despite the issues it finds) to not totally break the otherwise functional filters.