title: Report PHP errors in JSON format complying with the regular content-type
body: <p>I use AngularJs for a single page application and communicate with serverside PHP via JSON. The php header sets JSON, but the error reporting from php:</p>
  
  <pre><code>php_flag display_errors 1
  php_flag display_startup_errors 1
  php_value error_reporting 32767
  </code></pre>
  
  <p>is html and not matching the content-type header of the regular answer <code>header('Content-Type: application/json;charset=utf-8');
  </code> <br>Therefore  angularjs constantly throws on php errors. Should I use <a href="https://stackoverflow.com/a/2428011/4933053">multicontent types</a>  or what to do? </p>
  
  <p><a href="https://i.stack.imgur.com/6E1pX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6E1pX.png" alt="enter image description here"></a></p>