What are the potential pitfalls of using ob_start(), ob_get_contents(), and ob_end_clean() in PHP code?

Using ob_start(), ob_get_contents(), and ob_end_clean() can lead to potential pitfalls such as memory consumption issues if output buffering is not managed properly. To avoid these pitfalls, it is important to ensure that ob_end_clean() is called after ob_get_contents() to clear the output buffer and free up memory.

ob_start();
// Your PHP code here
$output = ob_get_contents();
ob_end_clean();