>On 5/30/06, Arno Kuhl <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
Sent: 30 May 2006 02:11
To: [EMAIL PROTECTED]
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
 [EMAIL PROTECTED]
 www.dotcontent.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to