View Single Post
Old 03-17-2006, 08:33 AM  
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
PHP Experts, Optimization question

Looking to optimize a lengthy switch/case statement. Working on something like this, and considering how to optimize it and speed it up. It's not that slow yet but it might be when it's finished.

Code:
switch($var) {
  case 'val1':
      $action = 'step1';  break;
 case 'val2':
      $action = 'step2';  break;

 .. and so on for about 200 more of these ..

 default:
      $action = 'do the hokey pokey';  break;
}
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote