make switch use === comparison not == comparison In PHP

后端 未结 15 2129
一向
一向 2020-11-28 07:09

Is there anyway to make it so that the following code still uses a switch and returns b not a? Thanks!

$var = 0;
switch($var) {
            


        
15条回答
  •  春和景丽
    2020-11-28 07:33

    make switch use === comparison not == comparison In PHP

    Unfortunately switch uses loose comparison and as far as I know there's no way to change that.

提交回复
热议问题