Re: include vs. function

From: Date: Wed, 23 Aug 2000 16:24:50 +0000
Subject: Re: include vs. function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13180@lists.php.net to get a copy of this message
Unless your files are huge (megabytes of code), you should not use include() to simulate functions. I've yet to see a situation where this was justified. Zeev At 10:12 23-08-00, Jesse Binam wrote:
Hey all,
        I am wondering as far as performance which would be better?
####### # Scenario 1 ####### include("file.php"); include("file.php"); include("file2.php"); include("file2.php"); ####### # Scenario 2 ####### include("file.php"); function1(); function2(); function1(); I don't know the internal workings of php. But I see a few possible outcomes here. In Scenario 1 it loads each include into memory and caches all of them, Quickly eating memory. OR it loads 1 of them in to memory dumps it, gets it again, dumps it, etc. Causing a lot of disk I/O and causing a potential bottleneck. I think you can imagine all the possibilities here. So what would be best? Thanx, Jess -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.general (#13180) next »