Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43239 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68896 invoked from network); 4 Mar 2009 11:01:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2009 11:01:59 -0000 Authentication-Results: pb1.pair.com header.from=mike503@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mike503@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.237 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mike503@gmail.com X-Host-Fingerprint: 209.85.198.237 rv-out-0506.google.com Received: from [209.85.198.237] ([209.85.198.237:9959] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/D3-46234-6AF5EA94 for ; Wed, 04 Mar 2009 06:01:58 -0500 Received: by rv-out-0506.google.com with SMTP id b25so2982467rvf.23 for ; Wed, 04 Mar 2009 03:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=3q+E5J3kNCb4YGtwmDIOiqd4AhaA44PbedZ9ur5kaoI=; b=l558CCRQSpwet2N45NY7dFykqOScFOnhDFkM8oOoTcXTEZtenTpKbThI1hYw5BDZAb Y3WacXLPOakxT/4vhaFJQppCRWFBmT/ecX5Hp2OUYP9OCqsZYQnItdUph6U3ogB34jZ9 L23Fo5u2rYs2hFKcZn8kIkK8SBroqmHb7+TuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=hrSd1SUfRGPq1V3F5iUNQxr+9nhf12VpP9q1nFDvQPCV6CiVqxPHJ2oelS0UTutHHv 13CLfekeguMSA2c9546mDn5rwCOQ4NdD9oaRu2XmJVa8nI+ySAHamLToxFa15UwGDazY Tf2zLVkezkk/u45Rsm8r4rKiraPQfQiLi9zGo= MIME-Version: 1.0 Received: by 10.141.97.5 with SMTP id z5mr4101525rvl.212.1236164515606; Wed, 04 Mar 2009 03:01:55 -0800 (PST) Date: Wed, 4 Mar 2009 03:01:55 -0800 Message-ID: To: PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: How expensive are function_exists() calls? From: mike503@gmail.com (mike) 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