What are some potential drawbacks of using do-while loops in PHP for counting purposes?

One potential drawback of using do-while loops for counting purposes in PHP is that the loop will always execute at least once before checking the condition. This can lead to unnecessary iterations if the counting condition is not met initially. To solve this issue, you can use a while loop instead, which checks the condition before executing the loop body.

// Using a while loop for counting purposes
$count = 0;
while ($count < 10) {
    echo $count . "\n";
    $count++;
}