Re: safe_mode_include_dir

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

 



On Thu, December 13, 2007 1:49 pm, Nisse Engström wrote:
> On Wed, 12 Dec 2007 15:43:28 -0500, "Daniel Brown" wrote:
>
>>     Is there a specific reason you're using require_once() instead
>> of
>> include_once() ?  There actually is a difference.... include() and
>> include_once() will only include the file if that line of code is
>> executed, whereas require() and require_once() will include the file
>> even if the line is inside of an if() {} block for which the
>> condition(s) are never matched.
>
> Is that still the case?
>
> <http://se2.php.net/manual/en/function.require.php>:
>
>    "require() and include() are identical in every way except
>     how they handle failure."
>
>    "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."

The manual is correct.

The only real difference these days is that require issues an E_ERROR
(which halts processing) and include issues an E_WARNING (which lets
your script continue)

In olden times, the differences were bigger and more subtle, such as
order of compilation etc.  Few folks grokked it, and even fewer (like,
none) needed it, so it got simplified.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
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