remove duplicate codes in switch statement
<p>Let's say I have a switch statement like this:</p>

<pre><code>switch($myVar)
{
    case 'A':
        $special = 1;
        $total = $special + 5;
        break;

    case 'B':
        $special = 2;
        $total = $special + 5;
        break;

    case 'C':
        $special = 3;
        $total = $special + 5;
        break;
}
</code></pre>

<p>As you can see above, the only thing that differs from the cases of my switch statement is the variable <code>$special</code>. Its value should be 1 if case is A and 2 if case is B and so on. Apart from that the rest of the code after that stays the same. Is there a way that I can organize this switch statement to remove the duplicate code:</p>

<pre><code>$total = $special + 5
</code></pre>

<p>Thank you</p>
