What potential pitfalls or issues can arise when using the flush() function in PHP?

When using the flush() function in PHP, potential pitfalls include browser compatibility issues, as some browsers may not support this function properly. Additionally, using flush() can cause performance problems if not used correctly, as it sends output to the browser before the script has finished executing. To avoid these issues, it is important to use flush() in conjunction with ob_flush() and ob_end_flush() to properly flush output buffers.

ob_start();
echo "Hello, World!";
ob_flush();
flush();
ob_end_flush();