Switch case with three parameters?

前端 未结 7 1575
野趣味
野趣味 2020-12-17 20:49

Is it possible to use three parameters in switch-case, like this:

switch($var1, $var2, $var3){
    case true, false, false:
        echo \"Hello\";
        b         


        
7条回答
  •  星月不相逢
    2020-12-17 21:25

    I don't know - if you really want it this way - maybe cast them all to string, concatenate and then use the resulting string in your case condition?

提交回复
热议问题