What is the output from this PHP code?
Posted by Raj
What is the output from this PHP code?
$valid = TRUE;
$cnt = 0;
while ($valid = TRUE) {
$cnt++;
if ($cnt > 10) { $valid = FALSE; }
}
echo "$cnt";
Answer: infinite loops will run forever
$valid = TRUE;
$cnt = 0;
while ($valid = TRUE) {
$cnt++;
if ($cnt > 10) { $valid = FALSE; }
}
echo "$cnt";
Answer: infinite loops will run forever
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
.You can leave a response, or trackback from your own site.