note 53477 added to control-structures.continue
| From: | edmundathaselwanterdotcom at osu1 dot php dot net | Date: | Thu, 02 Jun 2005 17:11:57 +0000 |
| Subject: | note 53477 added to control-structures.continue | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89822@lists.php.net to get a copy of this message | ||
Comment to note from "njones at fredesign dot company":
The continue for the switch works as expected, it skips the rest of the switch statement. With your
example code you won't see something meaningful since you don't "exercise" this
behaviour.
<?php
$names = array("Mike", "Mary", "Jose", "Anna");
foreach ($names as $kid)
{
echo "before switch for $kid \n";
switch($kid) {
case "Mike":
continue;
echo "Case Mike\n";
break;
case "Jose":
echo "Case Jose\n";
case "Anna":
echo "Case Anna\n";
}
echo "after switch for $kid \n";
}
?>
----
Manual Page -- http://www.php.net/manual/en/control-structures.continue.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53477
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53477&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53477&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53477&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53477&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53477&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53477&report=yes
Search -- http://master.php.net/manage/user-notes.php