Efficiency question

From: Date: Wed, 26 Jul 2006 04:41:53 +0000
Subject: Efficiency question
Groups: php.general 
Request: Send a blank email to php-general+get-239784@lists.php.net to get a copy of this message
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

« previous php.general (#239784) next »