title: PHP: Output buffer callback not altering output
body: <p>I have an output buffer with callback function. When cleaning the buffer the callback function is executed, however, the string returned isn't being altered.</p>
  
  <p>I'm using following code:</p>
  
  <pre><code>&lt;?php
  ob_start('callback');
  print 'some text';
  error_log(ob_get_clean());
  
  function callback($content) {
    error_log('callback');
    return $content . ' altered'; 
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>callback
  some text
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>callback
  some text altered
  </code></pre>
  
  <p>What am I missing? I'm using PHP 5.3.10 in CLI.</p>
  
  <p><strong>Edit: the callback is being executed.</strong></p>
  
  <p>From the PHP manual:</p>
  
  <blockquote>
    <p>The function will be called when the output buffer is flushed (sent)
    or cleaned (with ob_flush(), ob_clean() or similar function) or when
    the output buffer is flushed to the browser at the end of the request.</p>
  </blockquote>