A switch will match the value to one of the cases and then continue
executing each line until it encounters the end of the switch block or
encounters a 'break'; It doesn't do any other validation after the initial
sucessfull case validation. I've never used a continue inside a switch
block but I doubt it will jump you to the default case.
Hope that helps,
Jason Cox
----- Original Message -----
From: "KAT 44" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 23, 2002 9:13 PM
Subject: [PHP] switch & continue statements
Hello,
I'm not sure if this is a newsgroup, list or direct e-mail
address. In any case, I ask of anybody who can answer my
question to *send me an e-mail* at [EMAIL PROTECTED],
and not answer on the list/newsgroup/etc. (Thank you.)
My question is the following:
When having a switch statement as follows:
switch($value) {
case something:
if(condition) {
do_my_stuff;
} else {
continue;
}
case something_else:
do_my_other_stuff;
default:
show_error_message;
}
Does the continue continue on evaluating (and comparing)
$value to the case statements, or does it give control to
the default: statement?
Simpler put:
Does a "continue" statement within a "switch" statement
pass control to that "switch" statement's "default:"
section?
Thanks,
KAT44
_________________________________________________________
Le journal des abonn�s Caramail - http://www.carazine.com
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php