Efficiency question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have googled around a bit, but not really found anything useful...

Which is more efficient? A case switch or a $$method style method?

An example:

switch($action) {
    case 'edit':
      //do some stuff
      .......
      return "edit_tpl.php";
    
    case 'whatever':
      //blah
      ......
      ......
}

OR:

$method=$this->convertToMethod($action);
unset($action);
return $this->$method();

Hope this is reasonably clear... Note the return on the latter code.

If anyone has any ideas around this, please let me know! Are there
underlying security risks in doing it this way?

--Paul

All Email originating from UWC is covered by disclaimer  http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux