RE: [PHP] how include works?
| From: | Arno Kuhl | Date: | Tue, 30 May 2006 14:12:15 +0000 |
| Subject: | RE: [PHP] how include works? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237083@lists.php.net to get a copy of this message | ||
>On 5/30/06, Arno Kuhl <akuhl@telkomsa.net> wrote:
>
> I understand the difference well enough, but I've never really understood
> the reason for having both. Is it to help find errors in sloppy coding, or
> is there a case where including a file more than once is desirable (and
> won't cause an error)?
-----Original Message-----
From: chris smith [mailto:dmagick@gmail.com]
Sent: 30 May 2006 02:11
To: arno@dotcontent.net
Cc: php-general@lists.php.net
Subject: Re: [PHP] how include works?
There was more of a difference earlier on.
On http://www.php.net/manual/en/function.require.php:
Note: Prior to PHP 4.0.2, the following applies: require() will
always attempt to read the target file, even if the line it's on never
executes.
Now it behaves the same way except for the failure method (require is
fatal, include is not).
--
I wasn't talking about the difference between require and include but rather
the difference between require and require_once (or include and
include_once). Why doesn't require just work the same way as require_once,
because I can't see the need for require -ing the same file more than once.
Possibly for someone that doesn't understand the purpose of functions, as
Peter suggested, but programming languages don't generally go out of their
way to cater for people who don't understand basic programming concepts.
Arno
________________________
DotContent
Professional Content Management Solutions
arno@dotcontent.net
www.dotcontent.net