RE: [PHP] Require() vs Include() - - c o n c l u s i o n

From: Date: Tue, 14 Nov 2000 05:53:28 +0000
Subject: RE: [PHP] Require() vs Include() - - c o n c l u s i o n
Groups: php.general 
Request: Send a blank email to php-general+get-25149@lists.php.net to get a copy of this message
I feel bad guys .. Sorry, I started that thread while writing a file that would include a class under any circumstances and I remembered that I never use require() so I wanted to ask you all your opinions on should I start using it or not, is there any probs or not .. I knew the functionality issues but not the performance and usability (religious) ones... my *personal* conclusion is: Include() is better for many reasons one of which is it's flexibility. basically there's nothing to fear if you use include() at any time instead require(); However require() handles remote includes (I didn't know it actually, I though that include() would do it too) and there's no point avoid using require() when you ARE POSITIVE that the file must be here and no special conditions you will be making to this part in feature. I realized that it was better to ask you all instead of trying to figure it out on my own, since not me only who learned something but even Joe (I guess), and it is a good resource for these who will be browsing PHP-General achieves later. Thank you all, I appreciate your *HOT* comments on this, Maxim Maletsky. -----Original Message----- From: Mark Peoples [mailto:gascsd@gascairlines.com] Sent: Tuesday, November 14, 2000 2:29 PM To: 'PHP General List. (E-mail)' Subject: RE: [PHP] Require() vs Include() I stand corrected. Thanks Lars. =) >From the manual (http://www.php.net/manual/function.include.php): Because include() is a special language construct, you must enclose it within a statement block if it is inside a conditional block. I knew sleeping through that CSE100 class a few years ago when they covered the differences between constructs and functions was a bad idea...waking up with a kink in my neck wasn't peachy either. Had a pleasant dream though. =) marco -- 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

« previous php.general (#25149) next »