In the switch statement, when i have a case with "||" it doesn't work properly.
$get = 'item';
switch ($get):
case 'items' || 'several-items':
echo 'items';
break;
case 'item':
echo 'item';
break;
endswitch;
This code outputs items
. Is this a php bug ?
$get = 'several';
outputs items
too.
So the problem is definitely with the '||' operator, because the following code works just fine:
$get = 'item';
switch ($get):
case 'items':
case 'several-items':
echo 'items';
break;
case 'item':
echo 'item';
break;
endswitch;