Not sure it can report unused variables, but PHP_CodeSniffer is nice when it comes to detecting problems in PHP source code.
Still, it's a command-line tool, and it's not integrated in Eclipse PDT...
As a sidenote :
- Unused variables (i.e. variables than get assigned a value, and are never used again) are not a problem in PHP -- so, they are not reported as error nor anything by PHP itself
- On the other hand, undeclared variables (i.e. variables that are being read from, while no value was assigned to them before) are not that good -- so, they are reported a notices by the PHP engine.
The post you are linking to is talking about the second kind, and not the first one.
To get undeclared/uninitialized variables reported by the PHP engine :
- You have to enable
error_reporting
, and configure it so it report E_NOTICE
- You can then have those reports either :
But, here too, this is not integrated in Eclipse -- and I've never seen a tool that would parse the PHP error log, and push the notices to Eclipse...