What are potential pitfalls of using endless loops in PHP?

Using endless loops in PHP can lead to performance issues, as they consume CPU resources indefinitely. It can also cause the script to hang or crash if not properly managed. To prevent these pitfalls, it's important to include a condition within the loop that will eventually evaluate to false, allowing the loop to exit.

// Example of preventing an endless loop by including a condition for loop exit
$count = 0;
while ($count < 10) {
    // loop logic here
    $count++;
}