note 8353 added to switch
| From: | lx at graphodata dot de | Date: | Thu, 07 Sep 2000 15:19:56 +0000 |
| Subject: | note 8353 added to switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4351@lists.php.net to get a copy of this message | ||
Careful when using something like this:
$var = 1;
switch ($var) {
default : $var2 = 100;
}
which IMHO should do the same as:
$var = 1;
$var2 = 100;
BUT it sometimes changes $var2 and sometimes not! Though this statement seems useless at first
sight, think of a later-on expansion with different conditions already in mind when i coded this.
http://www.php.net/manual/control-structures.switch.php