Function for simple math doesn’t work what am I doing wrong? [closed]

The correct syntax for switch/case is to have a colon : not a semi-colon ; after case, so…

case '+' :
    $result=$first+$second;
    break;

etc,