note 51552 added to control-structures.switch
| From: | jaw0121 at unt dot edu | Date: | Sun, 03 Apr 2005 20:16:34 +0000 |
| Subject: | note 51552 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87409@lists.php.net to get a copy of this message | ||
In response to akeel_din at sbcglobal dot net, who said:
"In the example, age <= 69, age is <= 29 and age <= 21 will all be true for someone
who is 20. Should have an age range check in the case(...)"
I'm a bit confused by what you mean. If someone is 20, the first case statement evaluates
properly and the switch statement is broken out of. Therefore, the remaining case statements, while
technically true, are never evaluated...
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51552
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51552&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51552&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51552&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51552&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51552&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51552&report=yes
Search -- http://master.php.net/manage/user-notes.php