Re: functions versus includes

From: Date: Mon, 12 Nov 2007 05:14:21 +0000
Subject: Re: functions versus includes
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-264343@lists.php.net to get a copy of this message
Nathan Nobbe wrote:
On Nov 11, 2007 11:52 PM, Chris <dmagick@gmail.com <mailto:dmagick@gmail.com>> wrote:
    As I said, it's a micro-optimization *shrug*. 0.0004 seconds difference
    over 10 iterations - wow ;)
actually it was just one iteration; the output isnt very clear, but thats the value of a variable. anyway, i was surprised to see the function was faster at all. i though the include would be faster. so not only is the function faster (if only but a bit) its also cleaner as well. i think a decision between the 2 approaches no-brainer.
I'd go for the approach that makes more sense in the application regardless of the milliseconds involved. If that's an include that's what I'll use. In the scheme of the whole app it won't make any difference. You'll waste so much time on "optimizing" crap like this when fixing a bad database query will actually make a noticable difference, or instead of calling a function inside a loop 50 times, you call it once and pass all the data in through an array. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#264343) next »