It seems like some people are using this to workaround output buffering instead of simply turning it off. To me, if you have an output buffer, it's there for a reason, otherwise you would either do stuff and use ob_flush() or ob_end_flush(), do stuff, and maybe ob_start() again.
Here's how to properly end all output buffers without having to suppress errors (due to there not being any buffers). If you do want a single level of output buffering, I've included a piece for that as well.
<?php
while (ob_get_level()) {ob_end_flush();}
$notcli=(int)(PHP_SAPI!=='cli');
while (($diff=ob_get_level()-$notcli)!==0) {
if ($diff>0) {ob_end_flush();}
else {ob_start();}
}