RE: [PHP] Require_once problem
| From: | Ford, Mike [LSS] | Date: | Fri, 01 Nov 2002 14:43:40 +0000 |
| Subject: | RE: [PHP] Require_once problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122424@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: @ Darwin [mailto:superbus22@attbi.com]
> Sent: 01 November 2002 10:17
>
> Well, the way I've read it is that if you use require within control
> structures then all files are included, regardless of whether
> the script
> exits before it reaches its next if...elseif...else or case
> statement. With
> include that does not happen. So the general rule of thumb
> would be to use
> require() if you are not using it within these control
> structures, and use
> include() if you actually do need to use include statements
> in your control
> structures.
That's how it *used* to work (somewhere back around 4.0.3, if memory
serves). Now, the only difference is that the require versions will produce
a fatal error if the file is not present, whereas the include versions will
only generate a warning.
Cheers!
Mike
----------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Beckett Park
Tel: extn 4730 Fax: extn 3211