On Sun, 17 Aug 2003, Gabor Hojtsy wrote:
> >>>actually, array and return are language constructs, so they should have
> >>>the space, like:
> >>
> >>>array ('foo');
> >>
> >>That elements are lang.contructs, but looks like as functions.
> >>So, i checked PEAR codes. All PEAR codes (including class Pear
> >>in PEAR.php) handles array() as functions, without spaces before
> >>opening bracket.
> >
> > It's still wrong :) array and return are not functions, they might look
> > like them, but they aren't. The whole point of not using a space between
> > functionname and parameters, and using a space with constructs is that
> > you then can easily seperate them.
>
> As far as I interpret PEAR CS, you add space between control structures
> and parentheses, eg. "if (", but not between other constructs, like
> "echo(". There is no statement on function looking non-functions in PEAR
You shouldn't use () with echo anyway, it can do things you won't
expect. array and return are control structures too, so I don't see why
they should be different. (array is not that obvious, but return is
definitely a control structure (it controls the end of a
function/include file)). Both echo and return do not need ()'s
anyway... unless you really need to group things (which only makes sense
with return of course).
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
International PHP Magazine http://php-mag.net/
-------------------------------------------------------------------------
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php