RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

From: Date: Wed, 11 Feb 2004 12:03:24 +0000
Subject: RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively
Groups: php.general 
Request: Send a blank email to php-general+get-177371@lists.php.net to get a copy of this message
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: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#177371) next »