For something like that that, unless you are doing it inside a loop, I wouldn't really worry about efficiency as much as I would about security On 7/26/06, Paul Scott <pscott@xxxxxxxxx> wrote:
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