What are the potential pitfalls of using an endless loop in PHP for website functionality?

Using an endless loop in PHP for website functionality can lead to high server resource consumption, causing the website to become unresponsive or crash. To avoid this, it's important to include a condition within the loop that will eventually break out of it.

// Example of how to avoid an endless loop by including a condition to break out of it
$count = 0;

while ($count < 10) {
    // Perform website functionality here

    // Increment count to eventually break out of the loop
    $count++;
}