I'am allways developing php stuff with error reporting and notices actived. But now i have to refactor a huge project and its produces a lot of php notice messages. This drives me nuts.
Is there an easy way to discover all the lines which will produce such a messag开发者_运维百科e in a single run? Maybe a cli tool?
You can try the PHPLint project for which there is an online demo. You can also download it.
You can write your own error_handler(), that catches the notices (and so on), and write them to a file. After that you can just parse the file and extract (e.g.) every line, that contains the keywords NOTICE
.
Sadly this is more a "try-and-error", because it catches only notices, that occurs, if the corresponding code is executed.
精彩评论