What are the potential pitfalls of using Goto in PHP loops and how can they be avoided?

Using Goto in PHP loops can lead to unreadable and hard-to-maintain code. It can also make the code more prone to errors and bugs. To avoid these pitfalls, it is recommended to refactor the code to use more structured control flow constructs like `break`, `continue`, or nested loops.

// Example of refactoring code that uses Goto in a loop
$counter = 0;

while ($counter < 10) {
    if ($counter == 5) {
        $counter++;
        continue;
    }

    echo $counter . PHP_EOL;
    $counter++;
}