PMD can be utilized in finding possible bugs, unused variables and methods, bad performance code blocks, unnecessary if statements, duplicate code, wrongfully expressed for loops that could be rewritten as while loops and many other more.
A PHP port of this can be found here.
What's New in This Release: [ read full changelog ]
· Many bug fixes and new rules
· Internal refactoring which breaks compatibility, but adds generic support for additional languages.
· Maven coordinates have been changed