TysonAndre / phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Other
0 stars 0 forks source link

Idea: Warn about unused results of methods that have no side effects (count, strlen, etc) #222

Closed TysonAndre closed 5 years ago

TysonAndre commented 5 years ago

Checking if the result of the function/method is used is one way (Similar to how PhanUnusedConstant, etc.) works.

If 99%+ of the invocations of an internal function/method are used across various projects, it's a good indication to warn about the other <1% of invocations.

Expect to see json_encode, json_decode, sprintf, ->offsetExists(), etc.