<?php
$i = 0;
do {
echo $i;
} while ($i > 0);
?>
This do
/ while
loop only runs once and then exits:
$i
equal to 0
.$i
, which is 0
.while ($i >0);
is checked. Since $i
is not greater than 0, the condition evaluates tofalse, and the
do/
while` loop stops.