Of cource changing the require with include would explain everything :-) Sorry, forgot to mention that :-)
Maxim Maletsky www.PHPBeginner.com > -----Original Message----- > From: Maxim Maletsky (PHPBeginner.com) > [mailto:[EMAIL PROTECTED]] > Sent: venerd́ 5 ottobre 2001 3.33 > To: 'Opec Kemp'; [EMAIL PROTECTED] > Subject: RE: [PHP] PHP is a Bloated Kludge, discuss! > > > > > PHP on the other hand seems to load in ALL the code that > > MAY be run. > > > i.e. an include brings things in which are inside an if, > > even if the > > > if equates to false. > > > > A quick check in the manual, it states that: > > > > "Unlike include(), require() will always read in the target > > file, even if the line it's on never executes. If you want to > > conditionally include a file, use include(). The conditional > > statement won't affect the require(). However, if the line on > > which the require() occurs is not executed, neither will any > > of the code in the target file be executed. " > > http://www.php.net/manual/en/function.require.php > > and > > http://www.php.net/manual/en/function.require-once.php > > > > > > So to do what you said i.e. conditionally load the > > function/files that you want then you should use include(). > > http://www.php.net/manual/en/function.include.php > > and > > http://www.php.net/manual/en/function.include-once.php > > > > So I don't buy this agument. > > This is outdated. Look int othe archives - I had this > discussion with Zeev close to a year ago - since PHP > 4.0.(something) require and include behaves in the exactly same way. > > Test it yourself on the latest release of PHP: > > > require.test.php > ---- > <? > > echo 'included?'; > > if($go) > require 'require.error.test'; > > ?> > ---- > > require.error.test > ---- > <? > > echo '<H1>yup!</H1>'; > > parse error; > > ?> > ---- > > Access it with: > 1. require.test.php?go=e > > And then try it with: > 2. require.test.php > > > What do you buy now? > > > Maxim Maletsky > www.PHPBeginner.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] To contact the list > administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]