List all lines in PHP-files in a directory-tree that contain characters out of the ASCII 7Bit pane:
~ grep -nPR --include=*.php [\xE0-\xFF] *
Tip: If you run a project, specify upfront in which encoding files are provided. If you stick with UTF-8 do that w/o BOMs, you can look them up with grep as well. I worked in one company where three developers were looking for a bug in output for nearly a day until they realized that some BOM has been included in some PHP template … . grep can save you the day.
Related Ticket: #14735 – Encoding Issue in Files