RE: [PHP] INCLUDE vs Functions
| From: | Fifield, Mike | Date: | Thu, 27 Jun 2002 16:53:43 +0000 |
| Subject: | RE: [PHP] INCLUDE vs Functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-104185@lists.php.net to get a copy of this message | ||
I cannot answer this for sure but my guess would be that having separately
included files would be faster. There are two reasons for this. First
functions are almost always slower then regular php code. Second you will be
loading the entire "Routines.php" on every page even if you only require one
of the functions.
-----Original Message-----
From: Jeff Gannaway [mailto:webmaster@cactusgraphics.com]
Sent: Thursday, June 27, 2002 10:41 AM
To: php-general@lists.php.net
Subject: [PHP] INCLUDE vs Functions
I'm re-writing a medium-sized commercial site in PHP. There will be
elements that will on nearly every page. I was considering writing each
element as a program and then using INCLUDE statements wherever I wanted
that element displayed. Now I'm wondering if grouping all those elements
into 1 file and defining them as functions would save on system resources
and improve speed.
In other words is....
<?
include "Menu.php";
include "Ads.php";
include "Headlines.php";
?>
More or less efficient than...
<?
include "Routines.php";
Menu();
Ads();
Headlines();
?>
Thanks,
Jeff Gannaway
"It's a feeling of fresh opportunity. You're placed in a position a lot of
times where not only you're wanted, but where God feels you're needed."
-Jalen Rose on being traded to the Bulls
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php