What are the drawbacks of using ob_start() in combination with header redirects?

When using ob_start() in combination with header redirects, a common issue is that headers must be sent before any output is generated. This can lead to "headers already sent" errors. To solve this problem, you can use ob_clean() or ob_end_clean() to discard the output buffer before sending headers.

ob_start();

// Your code here

if (condition) {
    ob_end_clean();
    header("Location: newpage.php");
    exit;
}

ob_end_flush();