FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » require*/include*: compile-time or runtime?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: require*/include*: compile-time or runtime? [message #171041 is a reply to message #171040] Wed, 15 December 2010 21:03 Go to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/15/2010 2:48 PM, pakalk wrote:
> On 15 Gru, 19:14, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 12/15/2010 11:39 AM, pakalk wrote:
>>
>>> On 9 Gru, 01:11, Helmut Chang<use...@helmutchang.at> wrote:
>>
>>>> const FOO = 'Foo'.'Bar';
>>
>>>> or
>>
>>>> const BAR = 1 + 2;
>>
>>> Are you sure it is executed at compile-time?
>>
>> He is correct. Constants are evaluated at compile time, which is why
>> you cannot use an expression to initialize them.
>>
>> When you think about it, it makes sense. A constant is only evaluated
>> once, not every time you go past the definition (i.e. in a function).
>>
>
> Of course, it should be constant :) But I do not know if parse error
> is constant evaluation error ;) I mean.. it is syntax error, widely-
> considered instruction is not executed.
>
> Nevermind :) I am too poor in english to provide my point of view
> clearly :D (But I think about: "compile-time instruction" == "can do
> sth during compile-time", not "it is parsed at compile-time")
>
> Include/require are both run-time.

If there is a syntax error, NO instructions are executed. Parsing stops
at the syntax error and the process does not continue to execution.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: drupal php google analytics
Next Topic: Adsense approval Trick
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 17:22:23 GMT 2024

Total time taken to generate the page: 0.04460 seconds