switch($_SERVER["SCRIPT_NAME"]){
case "/index.php":
$this->pageId = 1;
break;
case "/shops/index.php":
$this->pageId = 2;
break;
case "/shops/dailydeals.php":
$this->pageId = 4;
break;
case "/shops/shops.php":
$this->pageId = 5;
break;
case "/shops/deals.php":
$this->pageId = 9;
break;
case "/shops/store.php":
$this->pageId = 10;
break;
case "/user/cashmail.php":
$this->pageId = 13;
break;
case "/user/cashmail.php":
$this->pageId = 13;
break;
default ;
$this->pageId = 1;
break;
}
What do you say about the above code? I am trying to decide if I should use curly braces on my case
arms or not. Each case in my example only has one line of code, so I am not using curly braces. Is there a performance difference between using with or without curly braces?