title: Disable echo and print in PHP
body: <p>This may seem like a funny question but in fact it's not, I would like to disable <code>echo</code>, <code>print</code> and other functions that may output to the buffer such as <code>readfile</code>.</p>
  
  <p>The reason why I would like to do this is to prevent the client from using <code>echo</code> or <code>print</code> outside the rules of my application, forcing them to compile their contents and send it to the output class, so that the whole buffer is managed.</p>
  
  <p>Now I know I can set up an output buffer at the start of my script and throw away any content, but this will not include things such as <code>header</code> and <code>set_cookie</code>, so my question may be interpreted as <em>How can I control the buffer for the head of the response</em></p>
  
  <p>Is there any possible way to manage all aspects of PHP's outputting, such as assign a callback to the main buffer rather then just the body of response?</p>