I have a function that returns me the response based on the value of the input. The code is something like this
$a = 5;
switch ($a) {
case 1: $b = 1;
break;
case 2 || 3 || 4: $b = 2;
break;
case 5: $b = 3;
break;
}
return $b;
This returns me the value 2 instead of 3 as it can clearly be seen in code. How does this happen?