Turn warnings into exceptions
As I keep looking this up in other projects that I've written, I'm putting it here so I can find it more easily. There are a number of built-in PHP functions that generate a notice or warning that you can't turn off when something goes wrong, such as parse_ini_file and file_get_contents. One common solution to this is to suppress using the @ operator: $result = @file_get_contents($url); if (false === $result) { // inspect error_get_last() to… continue reading.