August 2000
Intermediate to advanced
800 pages
13h 15m
English
When a break statement is encountered, execution jumps outside the innermost loop or switch statement. You've seen that this is essential to the usefulness of switch statements. It also has some application for loops. There are cases when you need to leave a loop block somewhere in the middle. Listing 3.6 shows this in action.
<?
while(true)
{
print("This line is printed.");
break;
print("This line will never be printed.");
}
?>
|
Read now
Unlock full access