On 11 February 2004 00:38, Adam Bregenzer contributed these pearls of
wisdom:

> On Tue, 2004-02-10 at 19:06, Richard Davey wrote:
>> This is slightly off-topic, but related to the include()
>> function. What is the given "standard" regarding when you
>> should or shouldn't use braces on a function.
> 
> [snip]
> 
>> Both work just fine. The manual includes examples of both
>> methods. So which do most people consider "the right way" ?
> 
> I always use parens on function calls, I think it is more
> readable. Also, some syntax highlighters look for it.

So you don't use parens on include?  (Because it's a language construct and
not a function ;)

That's my take on it -- for language constructs such as include, require,
echo, return, which don't require parentheses, I leave them off.  Including
the parens make them look like functions and, as a general rule, they don't
behave like functions, so the parens are misleading.

Mind you, there are exceptions: exit(), for example, is a language construct
but requires the parens (at least, that's what the fine manual appears to
say, and I've not tested it without!).

Cheers!

Mike

-- 
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

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

Reply via email to