How expensive are function_exists() calls?
| From: | mike | Date: | Wed, 04 Mar 2009 11:01:55 +0000 |
| Subject: | How expensive are function_exists() calls? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-43239@lists.php.net to get a copy of this message | ||
I am trying to figure out a strategy for multiple output formats on a
site, and it seems like I can have functions defined by default, but
have them defined -after- I've included the targetted format first.
However that would require
file1.php:
function foo() {}
file2.php
if(!function_exists('foo')) {
function foo() {}
}
Is this a very expensive thing to do? There would be a good number of
functions that would be leveraging this. Is it a no-no? or is it
pretty cheap?
Thanks
- mike