RE: how include works?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>On 5/30/06, Arno Kuhl <akuhl@xxxxxxxxxxxx> 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@xxxxxxxxx]
Sent: 30 May 2006 02:11
To: arno@xxxxxxxxxxxxxx
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  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@xxxxxxxxxxxxxx
 www.dotcontent.net

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux