What are some common pitfalls when using the continue statement in PHP foreach loops?

Common pitfalls when using the continue statement in PHP foreach loops include accidentally skipping over elements in the loop or causing unexpected behavior. To avoid this, make sure to place the continue statement within a conditional statement that checks for the specific condition under which you want to skip to the next iteration.

$numbers = [1, 2, 3, 4, 5];

foreach ($numbers as $number) {
    if ($number == 3) {
        continue; // Skip number 3
    }
    
    echo $number . "\n";
}