Re: Re: How expensive are function_exists() calls?

From: Date: Fri, 13 Mar 2009 05:10:50 +0000
Subject: Re: Re: How expensive are function_exists() calls?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-289973@lists.php.net to get a copy of this message
On Thu, 2009-03-12 at 21:55 -0700, mike wrote: > For templating ideas ... > > Would bytecode caches (APC) be able to work properly with this: > > function print_something($args, $output = 'html') { > switch($output) { > 'iphone': > print_something_iphone($args); > break; > default: > print_something_html($args); > break; > } > } > > > or something like this: > > function print_something($args, $output = 'html') { > if(function_exists('print_something_'.$output)) { > call_user_func('print_something_'.$output); > } > } I thought we covered a question just like this a week ago... yes this will not pose a problem for a bytecode cache. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#289973) next »