note 94577 modified in control-structures.switch by danbrown
| From: | danbrown@php.net | Date: | Thu, 12 Nov 2009 19:28:31 +0000 |
| Subject: | note 94577 modified in control-structures.switch by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162821@lists.php.net to get a copy of this message | ||
Note that there will adulterated results if a case is filled * with <true> it will always
passed
<?php
$str='test';
switch ($str){
case true: echo "true";break;
case 'test': echo "no results here";break;
case 2: echo "2"; break;
case false: echo "false"; break;
}
?>
--was--
<?php
/*
* Note that there will adulterated results if a case is filled * with <true>
* it will always passed
*/
$str='test';
switch ($str){
case true: echo "true";break;
case 'test': echo "no results here";break;
case 2: echo "2"; break;
case false: echo "false"; break;
}
?>
http://php.net/manual/en/control-structures.switch.php