switch labels in sub-blocks
| From: | Ard Biesheuvel | Date: | Fri, 28 May 2004 16:09:10 +0000 |
| Subject: | switch labels in sub-blocks | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10162@lists.php.net to get a copy of this message | ||
Hi all,
is there a specific reason why nested blocks in switch statements are not supported ? It can be very useful if you want to jump into the middle of the first iteration of a loop (like fetching rows from a result set where the first row might or might not be already present)
Eg.
switch ($i) {
case 0:
do {
// iteration
default:
} while ( /* some condition */ );
}
--
Ard