title: Detecting error-control operator
body: <p>Please tell me if this is correct. In my error handler, I need to be able to detect when the @ error-control operator was used to suppress errors, because some external libraries (sadly) use it a lot. Execution of the script should continue, just like when you don't use custom error handlers.</p>
  
  <p>When the at-sign is used, PHP temporarily sets error_reporting to 0. So at the start of a script we set error_reporting to any value but zero - we can now do some beautiful IF/ELSE magic. To avoid any errors being shown at the frontend, we also set display_errors to 0, this will override error_reporting (but we can still use it's value for magic).</p>
  
  <pre><code>&lt;?php
  
  ini_set('display_errors',0);
  error_reporting(E_ALL);
  
  function error_handler($errno, $errstr, $errfile, $errline)
  {
      if (error_reporting()===0) return;
      else die();
  }
  
  set_error_handler('error_handler');
  
  //This issues an error, but the handler will return and execution continues.
  //Remove the at-sign and the script will die()
  @file();
  
  echo 'Execution continued, hooray.';
  ?&gt;
  </code></pre>
  
  <p>So.. Are there no catches here? Except the one where the external library overrides my error handling.. (any tips on that?)</p>