I have to work on some legacy code. In a part of this code, there are two default
cases in a switch
:
switch (strtoupper($format)) {
case '4A0': {$format = array(4767.87,6740.79); break;}
// etc.
case 'A3': {$format = array(841.89,1190.55); break;}
case 'A4': default: {$format = array(595.28,841.89); break;}
case 'A5': {$format = array(419.53,595.28); break;}
// etc.
case 'ROYAL': {$format=array(433.70,663.30 ); break;}
default: $format = false;
}
It should have work before but it can't anymore now (since PHP7 multiple default cases will raise a E_COMPILE_ERROR error, BTW it's a good news!). I want to clean this code (I don't understand why some people added two default in a switch, I think it's weird and dirty) and remove one of the default, but I'm not sure to understand the purpose of that code, so I don't know which one I have to kill.
Assuming I don't want to break anything, should I remove the first default
or the second default
?